public static co Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient) { co _co = new co(); _co.m_rocrailClient = rocrailClient; _co.m_accessory = (bool?)xml.Attribute("accessory"); _co.m_addr = (int?)xml.Attribute("addr"); _co.m_asswitch = (bool?)xml.Attribute("asswitch"); _co.m_blink = (bool?)xml.Attribute("blink"); _co.m_blockid = (string)xml.Attribute("blockid"); _co.m_bus = (int?)xml.Attribute("bus"); _co.m_cmd = (string)xml.Attribute("cmd"); _co.m_desc = (string)xml.Attribute("desc"); _co.m_gate = (int?)xml.Attribute("gate"); _co.m_grpid = (string)xml.Attribute("grpid"); _co.m_id = (string)xml.Attribute("id"); _co.m_iid = (string)xml.Attribute("iid"); _co.m_inv = (bool?)xml.Attribute("inv"); _co.m_oid = (string)xml.Attribute("oid"); _co.m_ori = (string)xml.Attribute("ori"); _co.m_param = (int?)xml.Attribute("param"); _co.m_port = (int?)xml.Attribute("port"); _co.m_porttype = (int?)xml.Attribute("porttype"); _co.m_prot = (string)xml.Attribute("prot"); _co.m_show = (bool?)xml.Attribute("show"); _co.m_state = (string)xml.Attribute("state"); _co.m_svgtype = (int?)xml.Attribute("svgtype"); _co.m_toggleswitch = (bool?)xml.Attribute("toggleswitch"); _co.m_tristate = (bool?)xml.Attribute("tristate"); _co.m_type = (string)xml.Attribute("type"); _co.m_value = (int?)xml.Attribute("value"); _co.m_x = (int?)xml.Attribute("x"); _co.m_y = (int?)xml.Attribute("y"); _co.m_z = (int?)xml.Attribute("z"); Definitions.Tools.ParseList <actionctrl>(_co.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient); return(_co); }
public void Update(co element) { if (element.m_accessory.HasValue == true) { this.accessory = element.accessory; } if (element.m_addr.HasValue == true) { this.addr = element.addr; } if (element.m_asswitch.HasValue == true) { this.asswitch = element.asswitch; } if (element.m_blink.HasValue == true) { this.blink = element.blink; } 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_desc != null) { this.desc = element.desc; } if (element.m_gate.HasValue == true) { this.gate = element.gate; } if (element.m_grpid != null) { this.grpid = element.grpid; } 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_oid != null) { this.oid = element.oid; } if (element.m_ori != null) { this.ori = element.ori; } if (element.m_param.HasValue == true) { this.param = element.param; } if (element.m_port.HasValue == true) { this.port = element.port; } if (element.m_porttype.HasValue == true) { this.porttype = element.porttype; } if (element.m_prot != null) { this.prot = element.prot; } if (element.m_show.HasValue == true) { this.show = element.show; } if (element.m_state != null) { this.state = element.state; } if (element.m_svgtype.HasValue == true) { this.svgtype = element.svgtype; } if (element.m_toggleswitch.HasValue == true) { this.toggleswitch = element.toggleswitch; } if (element.m_tristate.HasValue == true) { this.tristate = element.tristate; } if (element.m_type != null) { this.type = element.type; } if (element.m_value.HasValue == true) { this.@value = element.@value; } if (element.m_x.HasValue == true) { this.x = element.x; } if (element.m_y.HasValue == true) { this.y = element.y; } if (element.m_z.HasValue == true) { this.z = element.z; } this.actionctrllist = element.actionctrllist; }