Example #1
0
 public void Update(program element)
 {
     if (element.m_acc.HasValue == true)
     {
         this.acc = element.acc;
     }
     if (element.m_addr.HasValue == true)
     {
         this.addr = element.addr;
     }
     if (element.m_cmd.HasValue == true)
     {
         this.cmd = element.cmd;
     }
     if (element.m_cv.HasValue == true)
     {
         this.cv = element.cv;
     }
     if (element.m_decaddr.HasValue == true)
     {
         this.decaddr = element.decaddr;
     }
     if (element.m_eeprom.HasValue == true)
     {
         this.eeprom = element.eeprom;
     }
     if (element.m_filename != null)
     {
         this.filename = element.filename;
     }
     if (element.m_iid != null)
     {
         this.iid = element.iid;
     }
     if (element.m_lncv.HasValue == true)
     {
         this.lncv = element.lncv;
     }
     if (element.m_lncvcmd.HasValue == true)
     {
         this.lncvcmd = element.lncvcmd;
     }
     if (element.m_lntype.HasValue == true)
     {
         this.lntype = element.lntype;
     }
     if (element.m_longaddr.HasValue == true)
     {
         this.longaddr = element.longaddr;
     }
     if (element.m_manu.HasValue == true)
     {
         this.manu = element.manu;
     }
     if (element.m_mode.HasValue == true)
     {
         this.mode = element.mode;
     }
     if (element.m_modid.HasValue == true)
     {
         this.modid = element.modid;
     }
     if (element.m_pom.HasValue == true)
     {
         this.pom = element.pom;
     }
     if (element.m_porttype.HasValue == true)
     {
         this.porttype = element.porttype;
     }
     if (element.m_prod.HasValue == true)
     {
         this.prod = element.prod;
     }
     if (element.m_rc.HasValue == true)
     {
         this.rc = element.rc;
     }
     if (element.m_rs.HasValue == true)
     {
         this.rs = element.rs;
     }
     if (element.m_strval1 != null)
     {
         this.strval1 = element.strval1;
     }
     if (element.m_strval2 != null)
     {
         this.strval2 = element.strval2;
     }
     if (element.m_strval3 != null)
     {
         this.strval3 = element.strval3;
     }
     if (element.m_val1.HasValue == true)
     {
         this.val1 = element.val1;
     }
     if (element.m_val10.HasValue == true)
     {
         this.val10 = element.val10;
     }
     if (element.m_val11.HasValue == true)
     {
         this.val11 = element.val11;
     }
     if (element.m_val12.HasValue == true)
     {
         this.val12 = element.val12;
     }
     if (element.m_val13.HasValue == true)
     {
         this.val13 = element.val13;
     }
     if (element.m_val14.HasValue == true)
     {
         this.val14 = element.val14;
     }
     if (element.m_val15.HasValue == true)
     {
         this.val15 = element.val15;
     }
     if (element.m_val16.HasValue == true)
     {
         this.val16 = element.val16;
     }
     if (element.m_val17.HasValue == true)
     {
         this.val17 = element.val17;
     }
     if (element.m_val18.HasValue == true)
     {
         this.val18 = element.val18;
     }
     if (element.m_val19.HasValue == true)
     {
         this.val19 = element.val19;
     }
     if (element.m_val2.HasValue == true)
     {
         this.val2 = element.val2;
     }
     if (element.m_val20.HasValue == true)
     {
         this.val20 = element.val20;
     }
     if (element.m_val21.HasValue == true)
     {
         this.val21 = element.val21;
     }
     if (element.m_val22.HasValue == true)
     {
         this.val22 = element.val22;
     }
     if (element.m_val23.HasValue == true)
     {
         this.val23 = element.val23;
     }
     if (element.m_val24.HasValue == true)
     {
         this.val24 = element.val24;
     }
     if (element.m_val25.HasValue == true)
     {
         this.val25 = element.val25;
     }
     if (element.m_val26.HasValue == true)
     {
         this.val26 = element.val26;
     }
     if (element.m_val27.HasValue == true)
     {
         this.val27 = element.val27;
     }
     if (element.m_val28.HasValue == true)
     {
         this.val28 = element.val28;
     }
     if (element.m_val29.HasValue == true)
     {
         this.val29 = element.val29;
     }
     if (element.m_val3.HasValue == true)
     {
         this.val3 = element.val3;
     }
     if (element.m_val30.HasValue == true)
     {
         this.val30 = element.val30;
     }
     if (element.m_val31.HasValue == true)
     {
         this.val31 = element.val31;
     }
     if (element.m_val32.HasValue == true)
     {
         this.val32 = element.val32;
     }
     if (element.m_val33.HasValue == true)
     {
         this.val33 = element.val33;
     }
     if (element.m_val34.HasValue == true)
     {
         this.val34 = element.val34;
     }
     if (element.m_val35.HasValue == true)
     {
         this.val35 = element.val35;
     }
     if (element.m_val36.HasValue == true)
     {
         this.val36 = element.val36;
     }
     if (element.m_val37.HasValue == true)
     {
         this.val37 = element.val37;
     }
     if (element.m_val38.HasValue == true)
     {
         this.val38 = element.val38;
     }
     if (element.m_val39.HasValue == true)
     {
         this.val39 = element.val39;
     }
     if (element.m_val4.HasValue == true)
     {
         this.val4 = element.val4;
     }
     if (element.m_val40.HasValue == true)
     {
         this.val40 = element.val40;
     }
     if (element.m_val41.HasValue == true)
     {
         this.val41 = element.val41;
     }
     if (element.m_val42.HasValue == true)
     {
         this.val42 = element.val42;
     }
     if (element.m_val43.HasValue == true)
     {
         this.val43 = element.val43;
     }
     if (element.m_val44.HasValue == true)
     {
         this.val44 = element.val44;
     }
     if (element.m_val45.HasValue == true)
     {
         this.val45 = element.val45;
     }
     if (element.m_val46.HasValue == true)
     {
         this.val46 = element.val46;
     }
     if (element.m_val47.HasValue == true)
     {
         this.val47 = element.val47;
     }
     if (element.m_val48.HasValue == true)
     {
         this.val48 = element.val48;
     }
     if (element.m_val49.HasValue == true)
     {
         this.val49 = element.val49;
     }
     if (element.m_val5.HasValue == true)
     {
         this.val5 = element.val5;
     }
     if (element.m_val50.HasValue == true)
     {
         this.val50 = element.val50;
     }
     if (element.m_val6.HasValue == true)
     {
         this.val6 = element.val6;
     }
     if (element.m_val7.HasValue == true)
     {
         this.val7 = element.val7;
     }
     if (element.m_val8.HasValue == true)
     {
         this.val8 = element.val8;
     }
     if (element.m_val9.HasValue == true)
     {
         this.val9 = element.val9;
     }
     if (element.m_value.HasValue == true)
     {
         this.@value = element.@value;
     }
     if (element.m_version.HasValue == true)
     {
         this.version = element.version;
     }
 }
Example #2
0
        public static program Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            program _program = new program();

            _program.m_rocrailClient = rocrailClient;
            _program.m_acc           = (bool?)xml.Attribute("acc");
            _program.m_addr          = (int?)xml.Attribute("addr");
            _program.m_cmd           = (int?)xml.Attribute("cmd");
            _program.m_cv            = (int?)xml.Attribute("cv");
            _program.m_decaddr       = (int?)xml.Attribute("decaddr");
            _program.m_eeprom        = (bool?)xml.Attribute("eeprom");
            _program.m_filename      = (string)xml.Attribute("filename");
            _program.m_iid           = (string)xml.Attribute("iid");
            _program.m_lncv          = (bool?)xml.Attribute("lncv");
            _program.m_lncvcmd       = (int?)xml.Attribute("lncvcmd");
            _program.m_lntype        = (int?)xml.Attribute("lntype");
            _program.m_longaddr      = (bool?)xml.Attribute("longaddr");
            _program.m_manu          = (int?)xml.Attribute("manu");
            _program.m_mode          = (int?)xml.Attribute("mode");
            _program.m_modid         = (int?)xml.Attribute("modid");
            _program.m_pom           = (bool?)xml.Attribute("pom");
            _program.m_porttype      = (int?)xml.Attribute("porttype");
            _program.m_prod          = (int?)xml.Attribute("prod");
            _program.m_rc            = (int?)xml.Attribute("rc");
            _program.m_rs            = (int?)xml.Attribute("rs");
            _program.m_strval1       = (string)xml.Attribute("strval1");
            _program.m_strval2       = (string)xml.Attribute("strval2");
            _program.m_strval3       = (string)xml.Attribute("strval3");
            _program.m_val1          = (int?)xml.Attribute("val1");
            _program.m_val10         = (int?)xml.Attribute("val10");
            _program.m_val11         = (int?)xml.Attribute("val11");
            _program.m_val12         = (int?)xml.Attribute("val12");
            _program.m_val13         = (int?)xml.Attribute("val13");
            _program.m_val14         = (int?)xml.Attribute("val14");
            _program.m_val15         = (int?)xml.Attribute("val15");
            _program.m_val16         = (int?)xml.Attribute("val16");
            _program.m_val17         = (int?)xml.Attribute("val17");
            _program.m_val18         = (int?)xml.Attribute("val18");
            _program.m_val19         = (int?)xml.Attribute("val19");
            _program.m_val2          = (int?)xml.Attribute("val2");
            _program.m_val20         = (int?)xml.Attribute("val20");
            _program.m_val21         = (int?)xml.Attribute("val21");
            _program.m_val22         = (int?)xml.Attribute("val22");
            _program.m_val23         = (int?)xml.Attribute("val23");
            _program.m_val24         = (int?)xml.Attribute("val24");
            _program.m_val25         = (int?)xml.Attribute("val25");
            _program.m_val26         = (int?)xml.Attribute("val26");
            _program.m_val27         = (int?)xml.Attribute("val27");
            _program.m_val28         = (int?)xml.Attribute("val28");
            _program.m_val29         = (int?)xml.Attribute("val29");
            _program.m_val3          = (int?)xml.Attribute("val3");
            _program.m_val30         = (int?)xml.Attribute("val30");
            _program.m_val31         = (int?)xml.Attribute("val31");
            _program.m_val32         = (int?)xml.Attribute("val32");
            _program.m_val33         = (int?)xml.Attribute("val33");
            _program.m_val34         = (int?)xml.Attribute("val34");
            _program.m_val35         = (int?)xml.Attribute("val35");
            _program.m_val36         = (int?)xml.Attribute("val36");
            _program.m_val37         = (int?)xml.Attribute("val37");
            _program.m_val38         = (int?)xml.Attribute("val38");
            _program.m_val39         = (int?)xml.Attribute("val39");
            _program.m_val4          = (int?)xml.Attribute("val4");
            _program.m_val40         = (int?)xml.Attribute("val40");
            _program.m_val41         = (int?)xml.Attribute("val41");
            _program.m_val42         = (int?)xml.Attribute("val42");
            _program.m_val43         = (int?)xml.Attribute("val43");
            _program.m_val44         = (int?)xml.Attribute("val44");
            _program.m_val45         = (int?)xml.Attribute("val45");
            _program.m_val46         = (int?)xml.Attribute("val46");
            _program.m_val47         = (int?)xml.Attribute("val47");
            _program.m_val48         = (int?)xml.Attribute("val48");
            _program.m_val49         = (int?)xml.Attribute("val49");
            _program.m_val5          = (int?)xml.Attribute("val5");
            _program.m_val50         = (int?)xml.Attribute("val50");
            _program.m_val6          = (int?)xml.Attribute("val6");
            _program.m_val7          = (int?)xml.Attribute("val7");
            _program.m_val8          = (int?)xml.Attribute("val8");
            _program.m_val9          = (int?)xml.Attribute("val9");
            _program.m_value         = (int?)xml.Attribute("value");
            _program.m_version       = (int?)xml.Attribute("version");
            return(_program);
        }