Exemplo n.º 1
0
        public static loconet Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            loconet _loconet = new loconet();

            _loconet.m_rocrailClient   = rocrailClient;
            _loconet.m_cmdstn          = (string)xml.Attribute("cmdstn");
            _loconet.m_ignorepowercmds = (bool?)xml.Attribute("ignorepowercmds");
            _loconet.m_purgetime       = (int?)xml.Attribute("purgetime");
            _loconet.m_reportaddr      = (int?)xml.Attribute("reportaddr");
            _loconet.m_resetlissy      = (bool?)xml.Attribute("resetlissy");
            _loconet.m_sensorquery     = (bool?)xml.Attribute("sensorquery");
            _loconet.m_slotping        = (bool?)xml.Attribute("slotping");
            _loconet.m_slots           = (int?)xml.Attribute("slots");
            _loconet.m_swack           = (bool?)xml.Attribute("swack");
            _loconet.m_swretry         = (int?)xml.Attribute("swretry");
            _loconet.m_swsleep         = (int?)xml.Attribute("swsleep");
            _loconet.m_syncfc          = (bool?)xml.Attribute("syncfc");
            _loconet.m_usedouble       = (bool?)xml.Attribute("usedouble");
            _loconet.m_usefc           = (bool?)xml.Attribute("usefc");
            _loconet.m_useidle         = (bool?)xml.Attribute("useidle");
            _loconet.m_useseq          = (bool?)xml.Attribute("useseq");
            Definitions.Tools.ParseList <options>(_loconet.m_optionslist, xml, "options", options.Parse, rocrailClient);
            Definitions.Tools.ParseList <slotserver>(_loconet.m_slotserverlist, xml, "slotserver", slotserver.Parse, rocrailClient);
            return(_loconet);
        }
Exemplo n.º 2
0
 public void Update(loconet element)
 {
     if (element.m_cmdstn != null)
     {
         this.cmdstn = element.cmdstn;
     }
     if (element.m_ignorepowercmds.HasValue == true)
     {
         this.ignorepowercmds = element.ignorepowercmds;
     }
     if (element.m_purgetime.HasValue == true)
     {
         this.purgetime = element.purgetime;
     }
     if (element.m_reportaddr.HasValue == true)
     {
         this.reportaddr = element.reportaddr;
     }
     if (element.m_resetlissy.HasValue == true)
     {
         this.resetlissy = element.resetlissy;
     }
     if (element.m_sensorquery.HasValue == true)
     {
         this.sensorquery = element.sensorquery;
     }
     if (element.m_slotping.HasValue == true)
     {
         this.slotping = element.slotping;
     }
     if (element.m_slots.HasValue == true)
     {
         this.slots = element.slots;
     }
     if (element.m_swack.HasValue == true)
     {
         this.swack = element.swack;
     }
     if (element.m_swretry.HasValue == true)
     {
         this.swretry = element.swretry;
     }
     if (element.m_swsleep.HasValue == true)
     {
         this.swsleep = element.swsleep;
     }
     if (element.m_syncfc.HasValue == true)
     {
         this.syncfc = element.syncfc;
     }
     if (element.m_usedouble.HasValue == true)
     {
         this.usedouble = element.usedouble;
     }
     if (element.m_usefc.HasValue == true)
     {
         this.usefc = element.usefc;
     }
     if (element.m_useidle.HasValue == true)
     {
         this.useidle = element.useidle;
     }
     if (element.m_useseq.HasValue == true)
     {
         this.useseq = element.useseq;
     }
     this.optionslist    = element.optionslist;
     this.slotserverlist = element.slotserverlist;
 }