Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 private PerfMonFile()
 {
     this.counterDictionary        = CounterDictionary.ReadFromFile(@"c:\temp\counters\index.dat");
     NWhisper.Whipser.CacheHeaders = true;
 }
Ejemplo n.º 3
0
 public static void WriteToFile(string path, CounterDictionary dictionary)
 {
     File.WriteAllText(path, JsonConvert.SerializeObject(dictionary, Formatting.Indented));
 }