예제 #1
0
 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;
 }
예제 #2
0
        /// <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);
                }
            }
        }
예제 #3
0
        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;
        }
예제 #4
0
 void TimelineFilteringProperty_StarChanged(StarKind obj)
 {
     if (obj == this.CurrentStarKind)
         RaiseRequireReaccept();
 }