public static string[] GetExtensions(FolderKind kind) { if (ExtensionDictionary.ContainsKey(kind) == false) { return(TryCatch.Current.Show(new string[0], $"{kind} 文件夹分类未指定后缀集")); } return(ExtensionDictionary[kind]); }
/// <exception cref="System.ArgumentException" /> public override void ReadFrom(YSection section) { base.ReadFrom(section); this.Logger.Trace($"executing {nameof(ItemGroup)}.{nameof(this.ReadFrom)} ({this.Name})..."); var kind = ((FolderKind)(section.GetNodeAsNumber("FolderKind"))); _ = kind == FolderKind.Invalid && Enum.TryParse(section.GetNodeAsString("FolderKind"), out kind); this.Kind = kind; this.Logger.Trace($"completed {nameof(ItemGroup)}.{nameof(this.ReadFrom)} ({this.Name})..."); }
public bool Add(string path, FolderKind kind) { var id = Guid.NewGuid(); var model = new FolderExcludeModel { Guid = id, Path = path, Type = kind, }; var key = CreateKey(model.Guid); base.Save(key, model); return(true); }
internal ThunderbirdFolder(FolderKind folderKind, string name, string folderPath, IFolder parentFolder, IStore clientStore) { this.folderKind = folderKind; this.name = name; this.folderPath = folderPath; this.parentFolder = parentFolder; this.store = clientStore; this.messageCount = this.CountEmails(); this.subFolders = new ArrayList(); this.PopulateFolder(); }
static bool IsAncestor(IFolder folder, FolderKind folderKind) { while (folder != null) { if (folder.Kind == folderKind) { return true; } folder = folder.ParentFolder; } return false; }