public override LoadResult GetFromConfig() { LoadResult result = new LoadResult(); XmlDocument latAlphabet = new XmlDocument(); try { latAlphabet.Load(fInputFileName); } catch (XmlException e) { result.Error = e; } catch (Exception ex) { result.Error = ex; } if (result.Error == null) { XmlElement letters = latAlphabet.DocumentElement; foreach (XmlNode letter in letters) { XmlNode rus = letter.Attributes["rus"]; XmlNode lat = letter.Attributes["lat"]; result.Data.Add(rus.Value, lat.Value); } } Thread.Sleep(3000); OnDictionaryLoaded(new LoaderEventArgs(result)); return(result); }
public override LoadResult GetFromConfig() { LoadResult result = new LoadResult(); string[] alphabet = new string[] { }; try { alphabet = File.ReadAllLines(fInputFileName); } catch (FileNotFoundException e) { result.Error = e; } if (result.Error == null) { foreach (string pair in alphabet) { string[] letters = pair.Split('|'); result.Data.Add(letters[0], letters[1]); } } return(result); }
public LoaderEventArgs(LoadResult result) { this.result = result; }