public void Update(sg element) { if (element.m_accessory.HasValue == true) { this.accessory = element.accessory; } if (element.m_addr.HasValue == true) { this.addr = element.addr; } if (element.m_addr2.HasValue == true) { this.addr2 = element.addr2; } if (element.m_addr3.HasValue == true) { this.addr3 = element.addr3; } if (element.m_addr4.HasValue == true) { this.addr4 = element.addr4; } if (element.m_aspect.HasValue == true) { this.aspect = element.aspect; } if (element.m_aspects.HasValue == true) { this.aspects = element.aspects; } if (element.m_asswitch.HasValue == true) { this.asswitch = element.asswitch; } if (element.m_blank.HasValue == true) { this.blank = element.blank; } if (element.m_blanknr.HasValue == true) { this.blanknr = element.blanknr; } if (element.m_blockid != null) { this.blockid = element.blockid; } if (element.m_bus.HasValue == true) { this.bus = element.bus; } if (element.m_cmd != null) { this.cmd = element.cmd; } if (element.m_cmdtime.HasValue == true) { this.cmdtime = element.cmdtime; } if (element.m_desc != null) { this.desc = element.desc; } if (element.m_dwarf.HasValue == true) { this.dwarf = element.dwarf; } if (element.m_gate1.HasValue == true) { this.gate1 = element.gate1; } if (element.m_gate2.HasValue == true) { this.gate2 = element.gate2; } if (element.m_gate3.HasValue == true) { this.gate3 = element.gate3; } if (element.m_gate4.HasValue == true) { this.gate4 = element.gate4; } if (element.m_green.HasValue == true) { this.green = element.green; } if (element.m_greennr.HasValue == true) { this.greennr = element.greennr; } if (element.m_id != null) { this.id = element.id; } if (element.m_iid != null) { this.iid = element.iid; } if (element.m_inv.HasValue == true) { this.inv = element.inv; } if (element.m_manual.HasValue == true) { this.manual = element.manual; } if (element.m_oid != null) { this.oid = element.oid; } if (element.m_ori != null) { this.ori = element.ori; } if (element.m_pair.HasValue == true) { this.pair = element.pair; } if (element.m_port1.HasValue == true) { this.port1 = element.port1; } if (element.m_port2.HasValue == true) { this.port2 = element.port2; } if (element.m_port3.HasValue == true) { this.port3 = element.port3; } if (element.m_port4.HasValue == true) { this.port4 = element.port4; } if (element.m_porttype.HasValue == true) { this.porttype = element.porttype; } if (element.m_prot != null) { this.prot = element.prot; } if (element.m_red.HasValue == true) { this.red = element.red; } if (element.m_rednr.HasValue == true) { this.rednr = element.rednr; } if (element.m_signal != null) { this.signal = element.signal; } if (element.m_state != null) { this.state = element.state; } if (element.m_symbolprefix != null) { this.symbolprefix = element.symbolprefix; } if (element.m_type != null) { this.type = element.type; } if (element.m_usepatterns.HasValue == true) { this.usepatterns = element.usepatterns; } if (element.m_usesymbolprefix.HasValue == true) { this.usesymbolprefix = element.usesymbolprefix; } if (element.m_white.HasValue == true) { this.white = element.white; } if (element.m_whitenr.HasValue == true) { this.whitenr = element.whitenr; } if (element.m_x.HasValue == true) { this.x = element.x; } if (element.m_y.HasValue == true) { this.y = element.y; } if (element.m_yellow.HasValue == true) { this.yellow = element.yellow; } if (element.m_yellownr.HasValue == true) { this.yellownr = element.yellownr; } if (element.m_z.HasValue == true) { this.z = element.z; } this.actionctrllist = element.actionctrllist; if (element.m_routeids != null) { this.routeids = element.routeids; } }
public static sg Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient) { sg _sg = new sg(); _sg.m_rocrailClient = rocrailClient; _sg.m_accessory = (bool?)xml.Attribute("accessory"); _sg.m_addr = (int?)xml.Attribute("addr"); _sg.m_addr2 = (int?)xml.Attribute("addr2"); _sg.m_addr3 = (int?)xml.Attribute("addr3"); _sg.m_addr4 = (int?)xml.Attribute("addr4"); _sg.m_aspect = (int?)xml.Attribute("aspect"); _sg.m_aspects = (int?)xml.Attribute("aspects"); _sg.m_asswitch = (bool?)xml.Attribute("asswitch"); _sg.m_blank = (int?)xml.Attribute("blank"); _sg.m_blanknr = (int?)xml.Attribute("blanknr"); _sg.m_blockid = (string)xml.Attribute("blockid"); _sg.m_bus = (int?)xml.Attribute("bus"); _sg.m_cmd = (string)xml.Attribute("cmd"); _sg.m_cmdtime = (int?)xml.Attribute("cmdtime"); _sg.m_desc = (string)xml.Attribute("desc"); _sg.m_dwarf = (bool?)xml.Attribute("dwarf"); _sg.m_gate1 = (int?)xml.Attribute("gate1"); _sg.m_gate2 = (int?)xml.Attribute("gate2"); _sg.m_gate3 = (int?)xml.Attribute("gate3"); _sg.m_gate4 = (int?)xml.Attribute("gate4"); _sg.m_green = (int?)xml.Attribute("green"); _sg.m_greennr = (int?)xml.Attribute("greennr"); _sg.m_id = (string)xml.Attribute("id"); _sg.m_iid = (string)xml.Attribute("iid"); _sg.m_inv = (bool?)xml.Attribute("inv"); _sg.m_manual = (bool?)xml.Attribute("manual"); _sg.m_oid = (string)xml.Attribute("oid"); _sg.m_ori = (string)xml.Attribute("ori"); _sg.m_pair = (bool?)xml.Attribute("pair"); _sg.m_port1 = (int?)xml.Attribute("port1"); _sg.m_port2 = (int?)xml.Attribute("port2"); _sg.m_port3 = (int?)xml.Attribute("port3"); _sg.m_port4 = (int?)xml.Attribute("port4"); _sg.m_porttype = (int?)xml.Attribute("porttype"); _sg.m_prot = (string)xml.Attribute("prot"); _sg.m_red = (int?)xml.Attribute("red"); _sg.m_rednr = (int?)xml.Attribute("rednr"); _sg.m_signal = (string)xml.Attribute("signal"); _sg.m_state = (string)xml.Attribute("state"); _sg.m_symbolprefix = (string)xml.Attribute("symbolprefix"); _sg.m_type = (string)xml.Attribute("type"); _sg.m_usepatterns = (int?)xml.Attribute("usepatterns"); _sg.m_usesymbolprefix = (bool?)xml.Attribute("usesymbolprefix"); _sg.m_white = (int?)xml.Attribute("white"); _sg.m_whitenr = (int?)xml.Attribute("whitenr"); _sg.m_x = (int?)xml.Attribute("x"); _sg.m_y = (int?)xml.Attribute("y"); _sg.m_yellow = (int?)xml.Attribute("yellow"); _sg.m_yellownr = (int?)xml.Attribute("yellownr"); _sg.m_z = (int?)xml.Attribute("z"); Definitions.Tools.ParseList <actionctrl>(_sg.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient); _sg.m_routeids = (string)xml.Attribute("routeids"); return(_sg); }