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>(); } }
/// <summary> /// Constructor /// </summary> public DictSerializ() { dict = new DictionaryEng_Rus <string, string>(); }