public new static DeviceType1 Load(XmlNode xml) { DeviceType1 result = new DeviceType1(xml.Attributes["id"].Value, xml.Attributes["description"].Value); result.DeviceId = 0x00; result.Parent = null; result.Extension = false; result.Index = 0; return(result); }
public static Device Load(XmlNode xml) { int type = int.Parse(xml.Attributes["type"].Value); switch (type) { case DeviceType.Type_1: return(DeviceType1.Load(xml)); case DeviceType.Type_2: return(DeviceType2.Load(xml)); default: throw new Exception("Nieobsługiwany typ urządzenia."); } }