public MpeToggleButton(MpeToggleButton button) : base(button)
 {
     MpeLog.Debug("MpeToggleButton(button)");
     Init();
     alternateTextureFocus   = button.alternateTextureFocus;
     alternateTextureNoFocus = button.alternateTextureNoFocus;
     toggled = button.toggled;
 }
예제 #2
0
 public MpeToggleButton(MpeToggleButton button) : base(button)
 {
   MpeLog.Debug("MpeToggleButton(button)");
   Init();
   alternateTextureFocus = button.alternateTextureFocus;
   alternateTextureNoFocus = button.alternateTextureNoFocus;
   toggled = button.toggled;
 }
        public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
        {
            base.Save(doc, node, parser, reference);
            MpeToggleButton toggle = null;

            if (reference != null && reference is MpeToggleButton)
            {
                toggle = (MpeToggleButton)reference;
            }
            // TextureFocus
            if (toggle == null || toggle.AlternateTextureFocus == null ||
                toggle.AlternateTextureFocus.Equals(AlternateTextureFocus) == false)
            {
                if (AlternateTextureFocus == null)
                {
                    parser.SetValue(doc, node, "AltTextureFocus", "-");
                }
                else
                {
                    parser.SetValue(doc, node, "AltTextureFocus", AlternateTextureFocus.Name);
                }
            }
            // AlternateTextureNoFocus
            if (toggle == null || toggle.AlternateTextureNoFocus == null ||
                toggle.AlternateTextureNoFocus.Equals(AlternateTextureNoFocus) == false)
            {
                if (AlternateTextureNoFocus == null)
                {
                    parser.SetValue(doc, node, "AltTextureNoFocus", "-");
                }
                else
                {
                    parser.SetValue(doc, node, "AltTextureNoFocus", AlternateTextureNoFocus.Name);
                }
            }
        }