Beispiel #1
0
 public DictSerializ(string path)
 {
     if (File.Exists(path))
     {
         string str = null;
         using (StreamReader sr = new StreamReader(path, Encoding.Default))
         {
             str = sr.ReadToEnd();
         }
         if (str != null && str != "")
         {
             var list = JsonConvert.DeserializeObject <List <KeyValuePair <string, string> > >(str);
             dict = new DictionaryEng_Rus <string, string>(list.ToArray());
         }
         else
         {
             dict = new DictionaryEng_Rus <string, string>();
         }
     }
     else
     {
         dict = new DictionaryEng_Rus <string, string>();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public DictSerializ()
 {
     dict = new DictionaryEng_Rus <string, string>();
 }