示例#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
        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);
        }
示例#3
0
        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);
        }
示例#4
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);
        }
        public CustomFileSystemCover(FileSystemInfo fileSystemElement)
        {
            this.fileSystemElement = fileSystemElement;

            coverExt = CoverExt.Load(fileSystemElement.FullName);
        }