示例#1
0
        internal XmlElement Save(XmlDocument pDocument)
        {
            XmlElement Element = pDocument.CreateElement("btn");

            Element.Attributes.Append(Utils.Xml.GetAttribute(pDocument, "value", mValue + ""));
            Element.Attributes.Append(Utils.Xml.GetAttribute(pDocument, "img", mImage));
            Element.Attributes.Append(Utils.Xml.GetAttribute(pDocument, "start", mStart + ""));
            Element.Attributes.Append(Utils.Xml.GetAttribute(pDocument, "end", mEnd + ""));
            Element.Attributes.Append(Utils.Xml.GetAttribute(pDocument, "text", mText));


            if (mSubChannels != null && mSubChannels.Count != 0)
            {
                for (int i = 0; i < mSubChannels.Count; i++)
                {
                    Channel  chan = (Channel)mSubChannels[i];
                    DmxValue val  = (DmxValue)mSubDmxValues[i];


                    XmlElement Cpy = pDocument.CreateElement("CopyTo");

                    Utils.Xml.AddAttribute(Cpy, pDocument, "Name", chan.Fixture.Name);
                    Utils.Xml.AddAttribute(Cpy, pDocument, "ChannelName", chan.Name);
                    Utils.Xml.AddAttribute(Cpy, pDocument, "Value", val.Value + "");
                    Element.AppendChild(Cpy);
                }
            }

            return(Element);
        }
示例#2
0
        internal bool EqualsTo(DmxValue pValue)
        {
            if (this.Text != pValue.Text)
            {
                return(false);
            }

            if (this.Image != pValue.Image)
            {
                return(false);
            }

            return(true);
        }
示例#3
0
 public ValueButton(DmxFramework.Channels.DmxValue pValue)
     : base()
 {
     mValue        = pValue;
     mDefaultColor = this.BackColor;
     if (mValue.Image != null && mValue.Image != "" && File.Exists(mValue.Image))
     {
         System.Drawing.Image img = Image.FromFile(mValue.Image);
         this.BackgroundImage       = img;
         this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
     }
     else
     {
         this.Text = mValue.Text;
     }
     this.MouseClick += new MouseEventHandler(ValueButton_MouseClick);
 }
示例#4
0
 internal void RefreshValue(DmxValue pValue)
 {
     this.mStart = pValue.StartValue;
     this.mEnd   = pValue.EndValue;
     this.mValue = pValue.Value;
 }