/// <summary> /// Loads menu theme settings from xml. /// </summary> /// <param name="element">xml element to load from.</param> internal void LoadMenu(IXmlElement element, ThemeColors colors) { this.menuHasShadow = UIUtils.FromString(element.GetAttributeValue("hasShadow", ""), this.menuHasShadow); this.colorMenuPopUpBack = colors.GetColor(element.GetAttributeValue("popUpBackColor", ""), this.colorMenuPopUpBack); this.menuHasPopUpBackImage = UIUtils.FromString(element.GetAttributeValue("hasPopUpBackImage", ""), this.menuHasPopUpBackImage); this.menuHasIconPlaceHolder = UIUtils.FromString(element.GetAttributeValue("hasIconPlaceholderImage", ""), this.menuHasIconPlaceHolder); this.menuSimple = UIUtils.FromString(element.GetAttributeValue("hasSimpleMenu", ""), this.menuSimple); }
/// <summary> /// Constructs menu theme object. /// </summary> internal MenuTheme(ThemeColors colors) { this.colorMenuPopUpBack = colors.Control; }
/// <summary> /// Loads menu theme settings from xml. /// </summary> /// <param name="element">xml element to load from.</param> internal void LoadMenu(IXmlElement element, ThemeColors colors) { this.menuHasShadow = UIUtils.FromString(element.GetAttributeValue("hasShadow", ""), this.menuHasShadow); this.colorMenuPopUpBack = colors.GetColor(element.GetAttributeValue("popUpBackColor", ""), this.colorMenuPopUpBack); this.menuHasPopUpBackImage = UIUtils.FromString(element.GetAttributeValue("hasPopUpBackImage", ""), this.menuHasPopUpBackImage); this.menuHasIconPlaceHolder = UIUtils.FromString(element.GetAttributeValue("hasIconPlaceholderImage", ""), this.menuHasIconPlaceHolder); this.menuSimple = UIUtils.FromString(element.GetAttributeValue("hasSimpleMenu", ""), this.menuSimple); }
internal void UpdateColor(String name, ThemeColors colors) { if ((null == name) || (0 == name.Length)) { return; } if (true == name.StartsWith("#")) { Color color = new Color(name.Substring(1)); this.colorArray[0] = color.colorArray[0]; this.colorArray[1] = color.colorArray[1]; this.colorArray[2] = color.colorArray[2]; this.colorArray[3] = color.colorArray[3]; } else { foreach (Color color in colors.SystemColors) { if (true == name.Equals(color.Name)) { this.colorArray[0] = color.colorArray[0]; this.colorArray[1] = color.colorArray[1]; this.colorArray[2] = color.colorArray[2]; this.colorArray[3] = color.colorArray[3]; return; } } } }
/// <summary> /// Constructs menu theme object. /// </summary> internal MenuTheme(ThemeColors colors) { this.colorMenuPopUpBack = colors.Control; }