Beispiel #1
0
        public new static DeviceType2 Load(XmlNode xml)
        {
            DeviceType2 result = new DeviceType2(xml.Attributes["id"].Value, xml.Attributes["description"].Value);

            result.DeviceId  = 0x00;
            result.Parent    = null;
            result.Extension = false;
            result.Index     = 0;
            return(result);
        }
Beispiel #2
0
        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.");
            }
        }