Beispiel #1
0
        public static CounterDictionary ReadFromFile(string path)
        {
            CounterDictionary dictionary = null;

            if (!File.Exists(path))
            {
                dictionary = new CounterDictionary();
            }
            else
            {
                dictionary = JsonConvert.DeserializeObject <CounterDictionary>(File.ReadAllText(path));
            }
            dictionary.Path = path;
            return(dictionary);
        }
Beispiel #2
0
 private PerfMonFile()
 {
     this.counterDictionary        = CounterDictionary.ReadFromFile(@"c:\temp\counters\index.dat");
     NWhisper.Whipser.CacheHeaders = true;
 }
Beispiel #3
0
 public static void WriteToFile(string path, CounterDictionary dictionary)
 {
     File.WriteAllText(path, JsonConvert.SerializeObject(dictionary, Formatting.Indented));
 }