public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeButton button = null; if (reference != null) { button = (MpeButton)reference; } // Size if (button == null || button.Size != Size) { parser.SetInt(doc, node, "width", Width); parser.SetInt(doc, node, "height", Height); } // hyperlink if (button == null || button.Hyperlink != Hyperlink) { parser.SetInt(doc, node, "hyperlink", Hyperlink); } // DiffuseColor if (button == null || button.DiffuseColor != DiffuseColor) { parser.SetColor(doc, node, "colordiffuse", DiffuseColor); } // TextOffsetX if (button == null || button.Padding.Left != Padding.Left) { parser.SetInt(doc, node, "textXOff", Padding.Left); } // TextOffsetY if (button == null || button.Padding.Top != Padding.Top) { parser.SetInt(doc, node, "textYOff", Padding.Top); } // TextureFocus if (button == null || button.TextureFocus == null || button.TextureFocus.Equals(TextureFocus) == false) { if (TextureFocus == null) { parser.SetValue(doc, node, "textureFocus", "-"); } else { parser.SetValue(doc, node, "textureFocus", TextureFocus.Name); } } // TextureNoFocus if (button == null || button.TextureNoFocus == null || button.TextureNoFocus.Equals(TextureNoFocus) == false) { if (TextureNoFocus == null) { parser.SetValue(doc, node, "textureNoFocus", "-"); } else { parser.SetValue(doc, node, "textureNoFocus", TextureNoFocus.Name); } } }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeLabel label = null; if (reference != null && reference is MpeLabel) { label = (MpeLabel)reference; } // Fix the Left Position if (Alignment == MpeControlAlignment.Right) { parser.SetInt(doc, node, "posX", Right); } // Fix the Width and Height parser.RemoveNode(node, "width"); parser.RemoveNode(node, "height"); // Text parser.SetValue(doc, node, "label", Text); // Font if (label == null || !label.Font.Name.Equals(Font.Name)) { parser.SetValue(doc, node, "font", Font.Name); } // Alignment if (label == null || label.Alignment != Alignment) { parser.SetValue(doc, node, "align", Alignment.ToString().ToLower()); } // Color if (label == null || label.TextColor != TextColor) { parser.SetColor(doc, node, "textcolor", TextColor); } // DisabledColor if (label == null || label.DisabledColor != DisabledColor) { parser.SetColor(doc, node, "disabledcolor", DisabledColor); } }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeSelectButton button = null; if (reference != null && reference is MpeSelectButton) { button = (MpeSelectButton)reference; } // Regular Button Properties parser.SetValue(doc, node, "label", label.Text); if (button == null || button.label.Font.Name.Equals(label.Font.Name) == false) { parser.SetValue(doc, node, "font", label.Font.Name); } if (button == null || button.label.Alignment != label.Alignment) { parser.SetValue(doc, node, "align", label.Alignment.ToString().ToLower()); } if (button == null || button.label.TextColor != label.TextColor) { parser.SetColor(doc, node, "textcolor", label.TextColor); } if (button == null || button.label.DisabledColor != label.DisabledColor) { parser.SetColor(doc, node, "disabledcolor", label.DisabledColor); } if (button == null || button.TextureButton == null || button.TextureButton.Equals(TextureButton) == false) { if (TextureButton == null) { parser.SetValue(doc, node, "textureNoFocus", "-"); } else { parser.SetValue(doc, node, "textureNoFocus", TextureButton.Name); } } if (button == null || button.TextureButtonFocus == null || button.TextureButtonFocus.Equals(TextureButtonFocus) == false) { if (TextureButtonFocus == null) { parser.SetValue(doc, node, "textureFocus", "-"); } else { parser.SetValue(doc, node, "textureFocus", TextureButtonFocus.Name); } } if (button == null || button.LabelPadding.Left != LabelPadding.Left) { parser.SetInt(doc, node, "textXOff2", LabelPadding.Left); } if (button == null || button.LabelPadding.Top != LabelPadding.Top) { parser.SetInt(doc, node, "textYOff2", LabelPadding.Top); } // Select Button Specific Properties if (button == null || button.TexturePadding.Width != TexturePadding.Width) { parser.SetInt(doc, node, "textXOff", TexturePadding.Width); } if (button == null || button.LabelPadding.Top != LabelPadding.Top) { parser.SetInt(doc, node, "textYOff", LabelPadding.Top); } if (button == null || button.textureSize != textureSize) { parser.SetInt(doc, node, "textureWidth", textureSize.Width); parser.SetInt(doc, node, "textureHeight", textureSize.Height); } if (button == null || button.TextureBackground == null || button.TextureBackground.Equals(TextureBackground) == false) { if (TextureBackground == null) { parser.SetValue(doc, node, "texturebg", "-"); } else { parser.SetValue(doc, node, "texturebg", TextureBackground.Name); } } if (button == null || button.TextureLeft == null || button.TextureLeft.Equals(TextureLeft) == false) { if (TextureLeft == null) { parser.SetValue(doc, node, "textureLeft", "-"); } else { parser.SetValue(doc, node, "textureLeft", TextureLeft.Name); } } if (button == null || button.TextureLeftFocus == null || button.TextureLeftFocus.Equals(TextureLeftFocus) == false ) { if (TextureLeftFocus == null) { parser.SetValue(doc, node, "textureLeftFocus", "-"); } else { parser.SetValue(doc, node, "textureLeftFocus", TextureLeftFocus.Name); } } if (button == null || button.TextureRight == null || button.TextureRight.Equals(TextureRight) == false) { if (TextureRight == null) { parser.SetValue(doc, node, "textureRight", "-"); } else { parser.SetValue(doc, node, "textureRight", TextureRight.Name); } } if (button == null || button.TextureRightFocus == null || button.TextureRightFocus.Equals(TextureRightFocus) == false) { if (TextureRightFocus == null) { parser.SetValue(doc, node, "textureRightFocus", "-"); } else { parser.SetValue(doc, node, "textureRightFocus", TextureRightFocus.Name); } } XmlElement subitems = doc.CreateElement("subitems"); for (int i = 0; items != null && items.Values != null && i < items.Values.Count; i++) { XmlElement subitem = doc.CreateElement("subitem"); subitem.AppendChild(doc.CreateTextNode(items.Values[i].Value)); subitems.AppendChild(subitem); } node.AppendChild(subitems); //parser.SetValue(doc, node, "type", parser.ControlTypeToXmlString(Type)); }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeSelectButton button = null; if (reference != null && reference is MpeSelectButton) { button = (MpeSelectButton) reference; } // Regular Button Properties parser.SetValue(doc, node, "label", label.Text); if (button == null || button.label.Font.Name.Equals(label.Font.Name) == false) { parser.SetValue(doc, node, "font", label.Font.Name); } if (button == null || button.label.Alignment != label.Alignment) { parser.SetValue(doc, node, "align", label.Alignment.ToString().ToLower()); } if (button == null || button.label.TextColor != label.TextColor) { parser.SetColor(doc, node, "textcolor", label.TextColor); } if (button == null || button.label.DisabledColor != label.DisabledColor) { parser.SetColor(doc, node, "disabledcolor", label.DisabledColor); } if (button == null || button.TextureButton == null || button.TextureButton.Equals(TextureButton) == false) { if (TextureButton == null) { parser.SetValue(doc, node, "textureNoFocus", "-"); } else { parser.SetValue(doc, node, "textureNoFocus", TextureButton.Name); } } if (button == null || button.TextureButtonFocus == null || button.TextureButtonFocus.Equals(TextureButtonFocus) == false) { if (TextureButtonFocus == null) { parser.SetValue(doc, node, "textureFocus", "-"); } else { parser.SetValue(doc, node, "textureFocus", TextureButtonFocus.Name); } } if (button == null || button.LabelPadding.Left != LabelPadding.Left) { parser.SetInt(doc, node, "textXOff2", LabelPadding.Left); } if (button == null || button.LabelPadding.Top != LabelPadding.Top) { parser.SetInt(doc, node, "textYOff2", LabelPadding.Top); } // Select Button Specific Properties if (button == null || button.TexturePadding.Width != TexturePadding.Width) { parser.SetInt(doc, node, "textXOff", TexturePadding.Width); } if (button == null || button.LabelPadding.Top != LabelPadding.Top) { parser.SetInt(doc, node, "textYOff", LabelPadding.Top); } if (button == null || button.textureSize != textureSize) { parser.SetInt(doc, node, "textureWidth", textureSize.Width); parser.SetInt(doc, node, "textureHeight", textureSize.Height); } if (button == null || button.TextureBackground == null || button.TextureBackground.Equals(TextureBackground) == false) { if (TextureBackground == null) { parser.SetValue(doc, node, "texturebg", "-"); } else { parser.SetValue(doc, node, "texturebg", TextureBackground.Name); } } if (button == null || button.TextureLeft == null || button.TextureLeft.Equals(TextureLeft) == false) { if (TextureLeft == null) { parser.SetValue(doc, node, "textureLeft", "-"); } else { parser.SetValue(doc, node, "textureLeft", TextureLeft.Name); } } if (button == null || button.TextureLeftFocus == null || button.TextureLeftFocus.Equals(TextureLeftFocus) == false ) { if (TextureLeftFocus == null) { parser.SetValue(doc, node, "textureLeftFocus", "-"); } else { parser.SetValue(doc, node, "textureLeftFocus", TextureLeftFocus.Name); } } if (button == null || button.TextureRight == null || button.TextureRight.Equals(TextureRight) == false) { if (TextureRight == null) { parser.SetValue(doc, node, "textureRight", "-"); } else { parser.SetValue(doc, node, "textureRight", TextureRight.Name); } } if (button == null || button.TextureRightFocus == null || button.TextureRightFocus.Equals(TextureRightFocus) == false) { if (TextureRightFocus == null) { parser.SetValue(doc, node, "textureRightFocus", "-"); } else { parser.SetValue(doc, node, "textureRightFocus", TextureRightFocus.Name); } } XmlElement subitems = doc.CreateElement("subitems"); for (int i = 0; items != null && items.Values != null && i < items.Values.Count; i++) { XmlElement subitem = doc.CreateElement("subitem"); subitem.AppendChild(doc.CreateTextNode(items.Values[i].Value)); subitems.AppendChild(subitem); } node.AppendChild(subitems); //parser.SetValue(doc, node, "type", parser.ControlTypeToXmlString(Type)); }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeSpinButton spin = null; if (reference != null && reference is MpeSpinButton) { spin = (MpeSpinButton)reference; } // Fix the Width and Height to be the texture size parser.SetInt(doc, node, "width", TextureSize.Width); parser.SetInt(doc, node, "height", TextureSize.Height); // Font if (spin == null || !spin.Font.Name.Equals(Font.Name)) { parser.SetValue(doc, node, "font", Font.Name); } // Alignment if (spin == null || spin.Alignment != Alignment) { parser.SetValue(doc, node, "align", Alignment.ToString().ToLower()); } // Color if (spin == null || spin.Color != Color) { parser.SetColor(doc, node, "textcolor", Color); } // DisabledColor if (spin == null || spin.DisabledColor != DisabledColor) { parser.SetColor(doc, node, "disabledcolor", DisabledColor); } // Orientation if (spin == null || spin.Orientation != Orientation) { parser.SetValue(doc, node, "orientation", Orientation.ToString().ToLower()); } // Reverse if (spin == null || spin.Reverse != Reverse) { parser.SetValue(doc, node, "reverse", Reverse ? "yes" : "no"); } // ShowRange if (spin == null || spin.ShowRange != ShowRange) { parser.SetValue(doc, node, "showrange", ShowRange ? "yes" : "no"); } // Textures if (spin == null || spin.TextureUp == null || spin.TextureUp.Equals(TextureUp) == false) { if (TextureUp == null) { parser.SetValue(doc, node, "textureUp", "-"); } else { parser.SetValue(doc, node, "textureUp", TextureUp.Name); } } if (spin == null || spin.TextureUpFocus == null || spin.TextureUpFocus.Equals(TextureUpFocus) == false) { if (TextureUpFocus == null) { parser.SetValue(doc, node, "textureUpFocus", "-"); } else { parser.SetValue(doc, node, "textureUpFocus", TextureUpFocus.Name); } } if (spin == null || spin.TextureDown == null || spin.TextureDown.Equals(TextureDown) == false) { if (TextureDown == null) { parser.SetValue(doc, node, "textureDown", "-"); } else { parser.SetValue(doc, node, "textureDown", TextureDown.Name); } } if (spin == null || spin.TextureDownFocus == null || spin.TextureDownFocus.Equals(TextureDownFocus) == false) { if (TextureDownFocus == null) { parser.SetValue(doc, node, "textureDownFocus", "-"); } else { parser.SetValue(doc, node, "textureDownFocus", TextureDownFocus.Name); } } // Items parser.SetValue(doc, node, "subtype", items.Type.ToString().ToLower()); XmlElement subitems = doc.CreateElement("subitems"); parser.SetValue(doc, subitems, "type", items.Type.ToString().ToLower()); parser.SetValue(doc, subitems, "first", items.First); parser.SetValue(doc, subitems, "last", items.Last); parser.SetValue(doc, subitems, "interval", items.Interval); parser.SetValue(doc, subitems, "digits", items.Digits); node.AppendChild(subitems); }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeButton button = null; if (reference != null) { button = (MpeButton) reference; } // Size if (button == null || button.Size != Size) { parser.SetInt(doc, node, "width", Width); parser.SetInt(doc, node, "height", Height); } // hyperlink if (button == null || button.Hyperlink != Hyperlink) { parser.SetInt(doc, node, "hyperlink", Hyperlink); } // DiffuseColor if (button == null || button.DiffuseColor != DiffuseColor) { parser.SetColor(doc, node, "colordiffuse", DiffuseColor); } // TextOffsetX if (button == null || button.Padding.Left != Padding.Left) { parser.SetInt(doc, node, "textXOff", Padding.Left); } // TextOffsetY if (button == null || button.Padding.Top != Padding.Top) { parser.SetInt(doc, node, "textYOff", Padding.Top); } // TextureFocus if (button == null || button.TextureFocus == null || button.TextureFocus.Equals(TextureFocus) == false) { if (TextureFocus == null) { parser.SetValue(doc, node, "textureFocus", "-"); } else { parser.SetValue(doc, node, "textureFocus", TextureFocus.Name); } } // TextureNoFocus if (button == null || button.TextureNoFocus == null || button.TextureNoFocus.Equals(TextureNoFocus) == false) { if (TextureNoFocus == null) { parser.SetValue(doc, node, "textureNoFocus", "-"); } else { parser.SetValue(doc, node, "textureNoFocus", TextureNoFocus.Name); } } }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeLabel label = null; if (reference != null && reference is MpeLabel) { label = (MpeLabel) reference; } // Fix the Left Position if (Alignment == MpeControlAlignment.Right) { parser.SetInt(doc, node, "posX", Right); } // Fix the Width and Height parser.RemoveNode(node, "width"); parser.RemoveNode(node, "height"); // Text parser.SetValue(doc, node, "label", Text); // Font if (label == null || !label.Font.Name.Equals(Font.Name)) { parser.SetValue(doc, node, "font", Font.Name); } // Alignment if (label == null || label.Alignment != Alignment) { parser.SetValue(doc, node, "align", Alignment.ToString().ToLower()); } // Color if (label == null || label.TextColor != TextColor) { parser.SetColor(doc, node, "textcolor", TextColor); } // DisabledColor if (label == null || label.DisabledColor != DisabledColor) { parser.SetColor(doc, node, "disabledcolor", DisabledColor); } }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeTextArea textarea = null; if (reference != null && reference is MpeTextArea) { textarea = (MpeTextArea) reference; } // Label Properties Point p = label.AbsoluteLocation; parser.SetInt(doc, node, "posX", p.X); parser.SetInt(doc, node, "posY", p.Y); parser.SetInt(doc, node, "width", label.Width); parser.SetInt(doc, node, "height", label.Height); parser.SetValue(doc, node, "text", Text); if (textarea == null || !textarea.Font.Name.Equals(Font.Name)) { parser.SetValue(doc, node, "font", Font.Name); } if (textarea == null || textarea.Color != Color) { parser.SetColor(doc, node, "textcolor", Color); } if (textarea == null || textarea.DisabledColor != DisabledColor) { parser.SetColor(doc, node, "disabledcolor", DisabledColor); } // SpinButton Properties p = spinButton.AbsoluteLocation; parser.SetInt(doc, node, "SpinPosX", p.X); parser.SetInt(doc, node, "SpinPosY", p.Y); if (textarea == null || textarea.SpinAlign != SpinAlign) { parser.SetValue(doc, node, "SpinAlign", SpinAlign.ToString().ToLower()); } if (textarea == null || textarea.SpinSize != SpinSize) { parser.SetInt(doc, node, "SpinWidth", SpinSize.Width); parser.SetInt(doc, node, "SpinHeight", SpinSize.Height); } if (textarea == null || textarea.SpinColor != SpinColor) { parser.SetColor(doc, node, "SpinColor", SpinColor); } if (textarea == null || textarea.TextureUp == null || textarea.TextureUp.Equals(TextureUp) == false) { if (TextureUp == null) { parser.SetValue(doc, node, "textureUp", "-"); } else { parser.SetValue(doc, node, "textureUp", TextureUp.Name); } } if (textarea == null || textarea.TextureUpFocus == null || textarea.TextureUpFocus.Equals(TextureUpFocus) == false ) { if (TextureUpFocus == null) { parser.SetValue(doc, node, "textureUpFocus", "-"); } else { parser.SetValue(doc, node, "textureUpFocus", TextureUpFocus.Name); } } if (textarea == null || textarea.TextureDown == null || textarea.TextureDown.Equals(TextureDown) == false) { if (TextureDown == null) { parser.SetValue(doc, node, "textureDown", "-"); } else { parser.SetValue(doc, node, "textureDown", TextureDown.Name); } } if (textarea == null || textarea.TextureDownFocus == null || textarea.TextureDownFocus.Equals(TextureDownFocus) == false) { if (TextureDownFocus == null) { parser.SetValue(doc, node, "textureDownFocus", "-"); } else { parser.SetValue(doc, node, "textureDownFocus", TextureDownFocus.Name); } } // Mpe if (Spacing != 0 || Padding.None == false) { XmlElement mpenode = doc.CreateElement("mpe"); node.AppendChild(mpenode); if (Spacing != 0) { parser.SetInt(doc, mpenode, "spacing", Spacing); } if (Padding.None == false) { parser.SetPadding(doc, mpenode, "padding", Padding); } } }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeTextArea textarea = null; if (reference != null && reference is MpeTextArea) { textarea = (MpeTextArea)reference; } // Label Properties Point p = label.AbsoluteLocation; parser.SetInt(doc, node, "posX", p.X); parser.SetInt(doc, node, "posY", p.Y); parser.SetInt(doc, node, "width", label.Width); parser.SetInt(doc, node, "height", label.Height); parser.SetValue(doc, node, "text", Text); if (textarea == null || !textarea.Font.Name.Equals(Font.Name)) { parser.SetValue(doc, node, "font", Font.Name); } if (textarea == null || textarea.Color != Color) { parser.SetColor(doc, node, "textcolor", Color); } if (textarea == null || textarea.DisabledColor != DisabledColor) { parser.SetColor(doc, node, "disabledcolor", DisabledColor); } // SpinButton Properties p = spinButton.AbsoluteLocation; parser.SetInt(doc, node, "SpinPosX", p.X); parser.SetInt(doc, node, "SpinPosY", p.Y); if (textarea == null || textarea.SpinAlign != SpinAlign) { parser.SetValue(doc, node, "SpinAlign", SpinAlign.ToString().ToLower()); } if (textarea == null || textarea.SpinSize != SpinSize) { parser.SetInt(doc, node, "SpinWidth", SpinSize.Width); parser.SetInt(doc, node, "SpinHeight", SpinSize.Height); } if (textarea == null || textarea.SpinColor != SpinColor) { parser.SetColor(doc, node, "SpinColor", SpinColor); } if (textarea == null || textarea.TextureUp == null || textarea.TextureUp.Equals(TextureUp) == false) { if (TextureUp == null) { parser.SetValue(doc, node, "textureUp", "-"); } else { parser.SetValue(doc, node, "textureUp", TextureUp.Name); } } if (textarea == null || textarea.TextureUpFocus == null || textarea.TextureUpFocus.Equals(TextureUpFocus) == false ) { if (TextureUpFocus == null) { parser.SetValue(doc, node, "textureUpFocus", "-"); } else { parser.SetValue(doc, node, "textureUpFocus", TextureUpFocus.Name); } } if (textarea == null || textarea.TextureDown == null || textarea.TextureDown.Equals(TextureDown) == false) { if (TextureDown == null) { parser.SetValue(doc, node, "textureDown", "-"); } else { parser.SetValue(doc, node, "textureDown", TextureDown.Name); } } if (textarea == null || textarea.TextureDownFocus == null || textarea.TextureDownFocus.Equals(TextureDownFocus) == false) { if (TextureDownFocus == null) { parser.SetValue(doc, node, "textureDownFocus", "-"); } else { parser.SetValue(doc, node, "textureDownFocus", TextureDownFocus.Name); } } // Mpe if (Spacing != 0 || Padding.None == false) { XmlElement mpenode = doc.CreateElement("mpe"); node.AppendChild(mpenode); if (Spacing != 0) { parser.SetInt(doc, mpenode, "spacing", Spacing); } if (Padding.None == false) { parser.SetPadding(doc, mpenode, "padding", Padding); } } }
public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { base.Save(doc, node, parser, reference); MpeSpinButton spin = null; if (reference != null && reference is MpeSpinButton) { spin = (MpeSpinButton) reference; } // Fix the Width and Height to be the texture size parser.SetInt(doc, node, "width", TextureSize.Width); parser.SetInt(doc, node, "height", TextureSize.Height); // Font if (spin == null || !spin.Font.Name.Equals(Font.Name)) { parser.SetValue(doc, node, "font", Font.Name); } // Alignment if (spin == null || spin.Alignment != Alignment) { parser.SetValue(doc, node, "align", Alignment.ToString().ToLower()); } // Color if (spin == null || spin.Color != Color) { parser.SetColor(doc, node, "textcolor", Color); } // DisabledColor if (spin == null || spin.DisabledColor != DisabledColor) { parser.SetColor(doc, node, "disabledcolor", DisabledColor); } // Orientation if (spin == null || spin.Orientation != Orientation) { parser.SetValue(doc, node, "orientation", Orientation.ToString().ToLower()); } // Reverse if (spin == null || spin.Reverse != Reverse) { parser.SetValue(doc, node, "reverse", Reverse ? "yes" : "no"); } // ShowRange if (spin == null || spin.ShowRange != ShowRange) { parser.SetValue(doc, node, "showrange", ShowRange ? "yes" : "no"); } // Textures if (spin == null || spin.TextureUp == null || spin.TextureUp.Equals(TextureUp) == false) { if (TextureUp == null) { parser.SetValue(doc, node, "textureUp", "-"); } else { parser.SetValue(doc, node, "textureUp", TextureUp.Name); } } if (spin == null || spin.TextureUpFocus == null || spin.TextureUpFocus.Equals(TextureUpFocus) == false) { if (TextureUpFocus == null) { parser.SetValue(doc, node, "textureUpFocus", "-"); } else { parser.SetValue(doc, node, "textureUpFocus", TextureUpFocus.Name); } } if (spin == null || spin.TextureDown == null || spin.TextureDown.Equals(TextureDown) == false) { if (TextureDown == null) { parser.SetValue(doc, node, "textureDown", "-"); } else { parser.SetValue(doc, node, "textureDown", TextureDown.Name); } } if (spin == null || spin.TextureDownFocus == null || spin.TextureDownFocus.Equals(TextureDownFocus) == false) { if (TextureDownFocus == null) { parser.SetValue(doc, node, "textureDownFocus", "-"); } else { parser.SetValue(doc, node, "textureDownFocus", TextureDownFocus.Name); } } // Items parser.SetValue(doc, node, "subtype", items.Type.ToString().ToLower()); XmlElement subitems = doc.CreateElement("subitems"); parser.SetValue(doc, subitems, "type", items.Type.ToString().ToLower()); parser.SetValue(doc, subitems, "first", items.First); parser.SetValue(doc, subitems, "last", items.Last); parser.SetValue(doc, subitems, "interval", items.Interval); parser.SetValue(doc, subitems, "digits", items.Digits); node.AppendChild(subitems); }
public virtual void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference) { if (doc != null && node != null) { // Type parser.SetValue(doc, node, "type", type.ToString()); // Description string s1 = Description != null ? Description : Type.ToString(); string s2 = (reference != null && reference.Description != null) ? reference.Description : Type.ToString(); if (reference == null || (!s1.Equals(s2))) { parser.SetValue(doc, node, "description", s1); } // Id parser.SetInt(doc, node, "id", Id); // Location - Absolute Positioning Point p = AbsoluteLocation; parser.SetInt(doc, node, "posX", p.X); parser.SetInt(doc, node, "posY", p.Y); // Size if (reference == null || reference.Width != Width) { parser.SetInt(doc, node, "width", Width); } // Height if (reference == null || reference.Height != Height) { parser.SetInt(doc, node, "height", Height); } // DiffuseColor if (reference == null || reference.DiffuseColor != DiffuseColor) { parser.SetColor(doc, node, "colordiffuse", DiffuseColor); } // DimColor if (reference == null || reference.DimColor != DimColor) { parser.SetColor(doc, node, "dimColor", DimColor); } // Animation Animation.Save(doc, node, parser); // Visible //if (Visible == false) //{ parser.SetValue(doc, node, "visible", Visible); //} // Actions if (OnLeft > 0) { parser.SetInt(doc, node, "onleft", OnLeft); } if (OnRight > 0) { parser.SetInt(doc, node, "onright", OnRight); } if (OnUp > 0) { parser.SetInt(doc, node, "onup", OnUp); } if (OnDown > 0) { parser.SetInt(doc, node, "ondown", OnDown); } string[] keys = tags.Keys; for (int i = 0; i < keys.Length; i++) { parser.SetValue(doc, node, keys[i], tags[keys[i]].Value); } } }