Exemplo n.º 1
0
 public void Update(rocnet element)
 {
     if (element.m_addr != null)
     {
         this.addr = element.addr;
     }
     if (element.m_crc.HasValue == true)
     {
         this.crc = element.crc;
     }
     if (element.m_id.HasValue == true)
     {
         this.id = element.id;
     }
     if (element.m_net.HasValue == true)
     {
         this.net = element.net;
     }
     if (element.m_port.HasValue == true)
     {
         this.port = element.port;
     }
     if (element.m_wd.HasValue == true)
     {
         this.wd = element.wd;
     }
     this.channelsetuplist      = element.channelsetuplist;
     this.macrolist             = element.macrolist;
     this.portsetuplist         = element.portsetuplist;
     this.rocnetnodelist        = element.rocnetnodelist;
     this.rocnetnodeoptionslist = element.rocnetnodeoptionslist;
 }
Exemplo n.º 2
0
        public static rocnet Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            rocnet _rocnet = new rocnet();

            _rocnet.m_rocrailClient = rocrailClient;
            _rocnet.m_addr          = (string)xml.Attribute("addr");
            _rocnet.m_crc           = (bool?)xml.Attribute("crc");
            _rocnet.m_id            = (int?)xml.Attribute("id");
            _rocnet.m_net           = (int?)xml.Attribute("net");
            _rocnet.m_port          = (int?)xml.Attribute("port");
            _rocnet.m_wd            = (bool?)xml.Attribute("wd");
            Definitions.Tools.ParseList <channelsetup>(_rocnet.m_channelsetuplist, xml, "channelsetup", channelsetup.Parse, rocrailClient);
            Definitions.Tools.ParseList <macro>(_rocnet.m_macrolist, xml, "macro", macro.Parse, rocrailClient);
            Definitions.Tools.ParseList <portsetup>(_rocnet.m_portsetuplist, xml, "portsetup", portsetup.Parse, rocrailClient);
            Definitions.Tools.ParseList <rocnetnode>(_rocnet.m_rocnetnodelist, xml, "rocnetnode", rocnetnode.Parse, rocrailClient);
            Definitions.Tools.ParseList <rocnetnodeoptions>(_rocnet.m_rocnetnodeoptionslist, xml, "rocnetnodeoptions", rocnetnodeoptions.Parse, rocrailClient);
            return(_rocnet);
        }