private static void Analysis(Folder folder, ICollection <ExtInfo> collection)
        {
            foreach (var file in folder.Files)
            {
                var ext = file.Extension.ToLower().Trim();

                var extInfo = new ExtInfo {
                    Name = ext, Count = 0, SumSize = 0
                };
                foreach (var info in collection.Where(info => info.Name == ext))
                {
                    extInfo = info;
                    break;
                }
                if (!collection.Contains(extInfo))
                {
                    collection.Add(extInfo);
                }

                extInfo.Count++;
                extInfo.SumSize += file.Length;
            }

            foreach (var f in folder.Folders)
            {
                Analysis(f, collection);
            }
        }
 private static void AddByExt(Folder folder, ICollection <FileInfo> collection, ExtInfo extInfo)
 {
     foreach (var file in folder.Files.Where(file => file.Extension.ToLower().Trim() == extInfo.Name))
     {
         collection.Add(file);
     }
     foreach (var f in folder.Folders)
     {
         AddByExt(f, collection, extInfo);
     }
 }