Beispiel #1
0
        void UpdateReadStats(string filename, int byteCount)
        {
            FileSystemStats stats = GetStatsForExtension(filename);

            stats.FilesRead += 1;
            stats.BytesRead += byteCount;
        }
Beispiel #2
0
        FileSystemStats GetStatsForExtension(string filename)
        {
            string          extension = Path.GetExtension(filename);
            FileSystemStats stats;

            if (!StatsByExtension.TryGetValue(extension, out stats))
            {
                stats = new FileSystemStats();
                StatsByExtension[extension] = stats;
            }
            return(stats);
        }