Ejemplo n.º 1
0
        public override string ToString()
        {
            bool allInSameDir = IndexedFiles.Count > 0 ? IndexedFiles.All(n => n.DirectoryName == IndexedFiles[0].DirectoryName) && !Main.SourceDirectoriesToIndex.Any(m => m.DirectoryInfo.FullName == IndexedFiles[0].DirectoryName) : false;
            bool savedTag     = Main.MoveTrackerList.MoveLocationExists(Term);

            string addedString = "";

            if (allInSameDir)
            {
                addedString += " " + Main.FilterShowTypes.GT.ToString();
            }

            if (savedTag)
            {
                addedString += " " + Main.FilterShowTypes.SV.ToString();
            }

            if (!allInSameDir && savedTag)
            {
                addedString += " " + Main.FilterShowTypes.MV.ToString();
            }

            if (!string.IsNullOrEmpty(addedString))
            {
                addedString = " -" + addedString;
            }

            return(Term + " - " + IndexedFiles.Where(n => n.Enabled).Distinct().Count() + addedString + (string.IsNullOrEmpty(Note) ? "" : " - " + Note) + (Rating == 0 ? "" : " - R" + Rating.ToString()));
        }
Ejemplo n.º 2
0
 public string SortString(SortTypes.SortType sort)
 {
     if (sort == SortTypes.SortType.AtoZ || sort == SortTypes.SortType.ZtoA)
     {
         return(Term + " " + IndexedFiles.Distinct().Count().ToString().PadLeft(10, '0'));
     }
     else if (sort == SortTypes.SortType.StoL || sort == SortTypes.SortType.LtoS)
     {
         return(IndexedFiles.Count.ToString().PadLeft(10, '0') + " " + Term);
     }
     else if (sort == SortTypes.SortType.NtoO || sort == SortTypes.SortType.OtoN)
     {
         return(IndexedFiles.Count > 0 ?
                IndexedFiles.OrderBy(n => n.File.LastWriteTimeUtc.ToFileTime()).First().File.LastWriteTimeUtc.ToFileTime().ToString() + " " + Term :
                new DateTime(2000, 1, 1).ToFileTime().ToString() + " " + Term);
     }
     else
     {
         return(Term);
     }
 }
Ejemplo n.º 3
0
 public void SortIndexedFiles(SortTypes.SortType sort)
 {
     if (sort == SortTypes.SortType.NtoO || sort == SortTypes.SortType.OtoN)
     {
         IndexedFiles.Sort(delegate(IndexedFileData a, IndexedFileData b)
         {
             if (SortTypes.IsReverseSortType(sort))
             {
                 return(b.SortString(sort).CompareTo(a.SortString(sort)));
             }
             else
             {
                 return(a.SortString(sort).CompareTo(b.SortString(sort)));
             }
         });
     }
     else
     {
         IndexedFiles.Sort(delegate(IndexedFileData a, IndexedFileData b)
         {
             return(a.SortString(sort).CompareTo(b.SortString(sort)));
         });
     }
 }
Ejemplo n.º 4
0
 public void Reset()
 {
     IndexedFiles = new IndexedFiles();
     IndexedTerms = new IndexedTerms();
 }
Ejemplo n.º 5
0
 public Indexer()
 {
     IndexedFiles = new IndexedFiles();
     IndexedTerms = new IndexedTerms();
 }