コード例 #1
0
        private static IEnumerable <IDEEvent> GetAllEventsFromFile(string file)
        {
            var zip        = ZipFile.Read(file);
            var fileLoader = new FeedbackArchiveReader();

            return(fileLoader.ReadAllEvents(zip));
        }
コード例 #2
0
 private IEnumerable <object> ReadFile(FeedbackArchiveBuilder feedbackArchive)
 {
     using (var zipFile = feedbackArchive.Create())
     {
         return(_sut.ReadAllEvents(zipFile));
     }
 }
コード例 #3
0
        public void Run()
        {
            var fileLoader = new FeedbackArchiveReader();

            Dictionary <Type, int> counts = new Dictionary <Type, int>();

            var archives = OpenFeedbackArchives();

            Console.Write("processing archives... ");
            foreach (var archive in archives)
            {
                Console.Write('*');
                foreach (var evt in fileLoader.ReadAllEvents(archive))
                {
                    var type = evt.GetType();

                    if (!counts.ContainsKey(type))
                    {
                        counts[type] = 1;
                    }
                    else
                    {
                        counts[type]++;
                    }
                }
            }
            Console.WriteLine("done");
            Console.WriteLine();

            Console.WriteLine("counts:");
            Console.WriteLine("=======");
            foreach (var type in counts.Keys)
            {
                Console.WriteLine("- {0}: {1}x", type, counts[type]);
            }
        }