Beispiel #1
0
 private static void SortFolder(VirtualFolder folder, TitlesFolder titles)
 {
     folder.AllItems.GroupBy(
         r => (r is IMetaInfo) ? ((r as IMetaInfo).InfoDate.ToString("yyyy-MMM")) : "Unknown",
         r => r,
         (k, g) => new { Key = k, Lst = g.ToList() }
         )
     .ToList()
     .ForEach(i => {
         var tf = titles.GetFolder(i.Key);
         i.Lst.ForEach(r => {
             tf.AddResource(r);
             folder.RemoveResource(r);
         });
     });
 }
Beispiel #2
0
        private static void SortFolder(VirtualFolder folder, TitlesFolder titles)
        {
            foreach (var f in folder.ChildFolders.ToList())
            {
                SortFolder(f as VirtualFolder, titles);
            }

            foreach (var c in folder.ChildItems.ToList())
            {
                var pre = c.Title.StemCompareBase();
                if (string.IsNullOrEmpty(pre))
                {
                    pre = "Unnamed";
                }
                pre = pre.First().ToString().ToUpperInvariant();
                titles.GetFolder(pre).AddResource(c);
                folder.RemoveResource(c);
            }
        }