예제 #1
0
 public void Update(fundef element)
 {
     if (element.m_addr.HasValue == true)
     {
         this.addr = element.addr;
     }
     if (element.m_fn.HasValue == true)
     {
         this.fn = element.fn;
     }
     if (element.m_icon != null)
     {
         this.icon = element.icon;
     }
     if (element.m_mappedfn.HasValue == true)
     {
         this.mappedfn = element.mappedfn;
     }
     if (element.m_offblockid != null)
     {
         this.offblockid = element.offblockid;
     }
     if (element.m_offevent != null)
     {
         this.offevent = element.offevent;
     }
     if (element.m_on.HasValue == true)
     {
         this.on = element.on;
     }
     if (element.m_onblockid != null)
     {
         this.onblockid = element.onblockid;
     }
     if (element.m_onevent != null)
     {
         this.onevent = element.onevent;
     }
     if (element.m_sound != null)
     {
         this.sound = element.sound;
     }
     if (element.m_text != null)
     {
         this.text = element.text;
     }
     if (element.m_timer.HasValue == true)
     {
         this.timer = element.timer;
     }
 }
예제 #2
0
        public static fundef Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            fundef _fundef = new fundef();

            _fundef.m_rocrailClient = rocrailClient;
            _fundef.m_addr          = (int?)xml.Attribute("addr");
            _fundef.m_fn            = (int?)xml.Attribute("fn");
            _fundef.m_icon          = (string)xml.Attribute("icon");
            _fundef.m_mappedfn      = (int?)xml.Attribute("mappedfn");
            _fundef.m_offblockid    = (string)xml.Attribute("offblockid");
            _fundef.m_offevent      = (string)xml.Attribute("offevent");
            _fundef.m_on            = (bool?)xml.Attribute("on");
            _fundef.m_onblockid     = (string)xml.Attribute("onblockid");
            _fundef.m_onevent       = (string)xml.Attribute("onevent");
            _fundef.m_sound         = (string)xml.Attribute("sound");
            _fundef.m_text          = (string)xml.Attribute("text");
            _fundef.m_timer         = (int?)xml.Attribute("timer");
            return(_fundef);
        }