/// <summary> /// Loads theme configuration from xml file. /// </summary> /// <param name="engine"></param> private void LoadTheme(UIEngine engine) { using (IXmlReader reader = engine.OpenXmlFile(this.themeFolder + "theme.xml")) { if (null != reader) { Load(reader); } } }
/// <summary> /// Constructs cached font. /// </summary> /// <param name="engine">ui engine.</param> /// <param name="fontName">font name.</param> /// <param name="size">font size.</param> /// <param name="bold">is font bold.</param> /// <param name="italic">is font italic.</param> public WinFontCached(UIEngine engine, String fontName, int size, bool bold, bool italic) : this(fontName, size, bold, italic) { IXmlReader reader = engine.OpenXmlFile(cacheFolder + ToString() + ".xml"); if ((null != reader) && (null != reader.RootElement)) { this.letters = new WinLetterCached[256 * 256]; foreach (IXmlElement element in reader.RootElement.Elements) { int code = int.Parse(element.GetAttributeValue("code", "0")); int index = int.Parse(element.GetAttributeValue("index", "0")); int us = int.Parse(element.GetAttributeValue("us", "0")); int vs = int.Parse(element.GetAttributeValue("vs", "0")); int ue = int.Parse(element.GetAttributeValue("ue", "0")); int ve = int.Parse(element.GetAttributeValue("ve", "0")); int w = int.Parse(element.GetAttributeValue("width", "0")); int offX = int.Parse(element.GetAttributeValue("x", "0")); int offY = int.Parse(element.GetAttributeValue("y", "0")); if ((this.cachedImages.Count <= index) || (this.cachedImages[index] != null)) { IImage img = engine.CreateImage(cacheFolder + ToString() + "_" + index); if (this.cachedImages.Count == index) { this.cachedImages.Add(img); } else { this.cachedImages[index] = img; } } if (code >= 0 && code < cacheLetters) { this.letters[code] = new WinLetterCached(engine); this.letters[code].SetCachedData(this.cachedImages[index], us, vs, ue, ve, w, offX, offY); } } this.loaded = true; } }
/// <summary> /// Constructs cached font. /// </summary> /// <param name="engine">ui engine.</param> /// <param name="fontName">font name.</param> /// <param name="size">font size.</param> /// <param name="bold">is font bold.</param> /// <param name="italic">is font italic.</param> public WinFontCached(UIEngine engine, String fontName, int size, bool bold, bool italic) : this(fontName, size, bold, italic) { IXmlReader reader = engine.OpenXmlFile(cacheFolder + ToString() + ".xml"); if ((null != reader) && (null != reader.RootElement)) { this.letters = new WinLetterCached[256 * 256]; foreach (IXmlElement element in reader.RootElement.Elements) { int code = int.Parse(element.GetAttributeValue("code", "0")); int index = int.Parse(element.GetAttributeValue("index", "0")); int us = int.Parse(element.GetAttributeValue("us", "0")); int vs = int.Parse(element.GetAttributeValue("vs", "0")); int ue = int.Parse(element.GetAttributeValue("ue", "0")); int ve = int.Parse(element.GetAttributeValue("ve", "0")); int w = int.Parse(element.GetAttributeValue("width", "0")); int offX = int.Parse(element.GetAttributeValue("x", "0")); int offY = int.Parse(element.GetAttributeValue("y", "0")); if ((this.cachedImages.Count <= index) || (this.cachedImages[index] != null)) { IImage img = engine.CreateImage(cacheFolder + ToString() + "_" + index); if (this.cachedImages.Count == index) { this.cachedImages.Add(img); } else { this.cachedImages[index] = img; } } if (code >= 0 && code < cacheLetters) { this.letters[code] = new WinLetterCached(engine); this.letters[code].SetCachedData(this.cachedImages[index], us, vs, ue, ve, w, offX, offY); } } this.loaded = true; } }
/// <summary> /// Loads theme configuration from xml file. /// </summary> /// <param name="engine"></param> private void LoadTheme(UIEngine engine) { using (IXmlReader reader = engine.OpenXmlFile(this.themeFolder + "theme.xml")) { if (null != reader) { Load(reader); } } }