internal CharacterSet GetFont(Guid?FontID) { if (FontID == null) { throw new ArgumentNullException(); } return(CharSets.FirstOrDefault(set => set.UID == FontID)); }
public void Load(String fileName) { Clear(false); Path = fileName; XElement xml = XElement.Load(fileName); foreach (XElement node in xml.Elements("font")) { AddCharSet(CharacterSet.Load(this, node), false); } foreach (XElement node in xml.Elements("include")) { AddInclude(node.Value, false); } foreach (XElement node in xml.Elements("map")) { Map loadedMap = MapDeserializer.Load(this, node); AddMap(loadedMap, false); CharacterSet characterSet = CharSets.FirstOrDefault(set => set.UID == loadedMap.FontID); if (characterSet == null) { MessageBox.Show("Unknown font: " + loadedMap.FontID); } } IsNew = false; IsDirty = false; StrutureTreeChanged?.Invoke(this, null); }
private CharacterSet findExistingCharsetByFileName(string fontFileName) { string exactFontPath = PathHelper.GetExactPath(Path, fontFileName); return(CharSets.FirstOrDefault(set => set.Path.Equals(exactFontPath, StringComparison.OrdinalIgnoreCase))); }