private void ReadFromFile(string filePath) { Debug.Try("Reading {0}...", (object)filePath); try { filePath = Engine.FileManager.ResolveMUL(filePath); if (File.Exists(filePath)) { using (StreamReader streamReader = new StreamReader(filePath)) { string str; while ((str = streamReader.ReadLine()) != null) { string line = str.Trim(); if (line.Length != 0 && !line.StartsWith("#", StringComparison.Ordinal)) { foreach (GraphicTranslation graphicTranslation in GraphicTranslation.Parse(line)) { if (!this.table.ContainsKey(graphicTranslation.UpdatedId)) { this.table.Add(graphicTranslation.UpdatedId, graphicTranslation); } } } } } } Debug.EndTry(); } catch (Exception ex) { Debug.FailTry(); Debug.Error(ex); } }
public int Convert(int graphicId) { GraphicTranslation graphicTranslation = this[graphicId]; if (graphicTranslation != null) { graphicId = graphicTranslation.FallbackId; } return(graphicId); }