Storage queries run in the background with cancellation and covering indexes so switching views no longer freezes the UI. Co-authored-by: Cursor <cursoragent@cursor.com>
139 lines
2.0 KiB
C#
139 lines
2.0 KiB
C#
namespace Explorer.Domain;
|
|
|
|
public enum SourceKind
|
|
{
|
|
NtfsLocal,
|
|
Removable,
|
|
Smb,
|
|
Nfs,
|
|
Cloud
|
|
}
|
|
|
|
public enum SourceStatus
|
|
{
|
|
Online,
|
|
Offline,
|
|
Scanning,
|
|
Stale,
|
|
Error
|
|
}
|
|
|
|
public enum EntryStatus
|
|
{
|
|
Present = 0,
|
|
Offline = 1,
|
|
Deleted = 2,
|
|
Unknown = 3
|
|
}
|
|
|
|
public enum HashState
|
|
{
|
|
None = 0,
|
|
Partial = 1,
|
|
Full = 2,
|
|
Skipped = 3
|
|
}
|
|
|
|
public enum CloudAvailability
|
|
{
|
|
Unknown = 0,
|
|
OnlineOnly = 1,
|
|
LocallyAvailable = 2,
|
|
Pinned = 3,
|
|
Syncing = 4,
|
|
Error = 5
|
|
}
|
|
|
|
public enum ExcludeKind
|
|
{
|
|
PathPrefix,
|
|
Glob,
|
|
Extension,
|
|
Attribute
|
|
}
|
|
|
|
public enum ScanKind
|
|
{
|
|
Full,
|
|
Incremental,
|
|
Folder,
|
|
Rebuild
|
|
}
|
|
|
|
public enum ScanJobStatus
|
|
{
|
|
Queued,
|
|
Running,
|
|
Cancelled,
|
|
Failed,
|
|
Done,
|
|
Interrupted
|
|
}
|
|
|
|
public enum TransferOp
|
|
{
|
|
Copy,
|
|
Move,
|
|
Delete,
|
|
Rename,
|
|
NewFolder
|
|
}
|
|
|
|
public enum TransferStatus
|
|
{
|
|
Queued,
|
|
Running,
|
|
Cancelling,
|
|
Cancelled,
|
|
Failed,
|
|
Done
|
|
}
|
|
|
|
public enum FolderViewMode
|
|
{
|
|
Details,
|
|
List,
|
|
Preview
|
|
}
|
|
|
|
public enum SearchScopeKind
|
|
{
|
|
CurrentFolder,
|
|
CurrentTree,
|
|
Selected,
|
|
Sources,
|
|
AllKnown,
|
|
OfflineMedia
|
|
}
|
|
|
|
public enum IndexFreshness
|
|
{
|
|
Unknown,
|
|
Current,
|
|
Scanning,
|
|
Stale,
|
|
Offline,
|
|
NotIndexed
|
|
}
|
|
|
|
public static class AttributeFlags
|
|
{
|
|
public const int ReadOnly = 1;
|
|
public const int Hidden = 2;
|
|
public const int System = 4;
|
|
public const int Directory = 16;
|
|
public const int Archive = 32;
|
|
public const int ReparsePoint = 1024;
|
|
public const int Offline = 0x1000;
|
|
public const int RecallOnOpen = 0x40000;
|
|
public const int Pinned = 0x80000;
|
|
public const int Unpinned = 0x100000;
|
|
public const int RecallOnDataAccess = 0x400000;
|
|
|
|
public static bool MayHydrateOnRead(int attributes)
|
|
=> (attributes & (RecallOnDataAccess | Offline)) != 0;
|
|
|
|
public static bool IsPinned(int attributes)
|
|
=> (attributes & Pinned) != 0 && (attributes & Unpinned) == 0;
|
|
}
|