private static CoverExt CreateCoverExt(string filePath, string description = null, StarKind? star = null) { CoverExt coverExt = new CoverExt(); coverExt.FilePath = filePath; coverExt.Description = description; coverExt.Star = star; coverExt.Hash = filePath.GetHashCode(); CoverExtList.Add(coverExt); return coverExt; }
private static CoverExt CreateCoverExt(string filePath, string description = null, StarKind?star = null) { CoverExt coverExt = new CoverExt(); coverExt.FilePath = filePath; coverExt.Description = description; coverExt.Star = star; coverExt.Hash = filePath.GetHashCode(); CoverExtList.Add(coverExt); return(coverExt); }
public static CoverExt LoadCoverExt(string filePath) { int filePathHex = filePath.GetHashCode(); CoverExt coverExt = null; foreach (var ce in CoverExtList) { if (ce.Hash == filePathHex) { coverExt = ce; } } return(coverExt); }
public static CoverExt CreateOrLoadCoverExt(string filePath, string description = null, StarKind?star = null) { CoverExt coverExt = LoadCoverExt(filePath); //foreach (var ce in CoverExtList) //{ // if (ce.Hash == filePathHex) // { // coverExt = ce; // } //} if (coverExt == null) { coverExt = CreateCoverExt(filePath, description, star); } return(coverExt); }
public CustomFileSystemCover(FileSystemInfo fileSystemElement) { this.fileSystemElement = fileSystemElement; coverExt = CoverExt.Load(fileSystemElement.FullName); }