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; }
/// <summary> /// Compare on base opacity of stars /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> protected int StarCompare(CustomFileSystemCover x, CustomFileSystemCover y) { StarKind?skX = x.Star; StarKind?skY = y.Star; if (skX == null) { if (skY == null) { return(0); } else { return(1); } } else { if (skY == null) { return(-1); } else { StarKind skXF = skX.GetValueOrDefault(StarKind.One); StarKind skYF = skY.GetValueOrDefault(StarKind.One); int c = skXF.CompareTo(skYF); int result = c; switch (c) { case -1: result = 1; break; case 1: result = -1; break; case 0: result = 0; break; } return(result); } } }
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; }
void TimelineFilteringProperty_StarChanged(StarKind obj) { if (obj == this.CurrentStarKind) RaiseRequireReaccept(); }