private void ReadDevices(XmlDocument doc) { XmlNode devicesNode = doc.GetElementsByTagName("Devices")[0]; foreach (XmlNode deviceClass in devicesNode.ChildNodes) { List<DeviceConfig> deviceList = new List<DeviceConfig>(); foreach (XmlNode deviceNode in deviceClass.ChildNodes) { DeviceConfig deviceConfig = new DeviceConfig(Convert.ToInt32(deviceNode.Attributes["DeviceNo"].Value), Convert.ToInt32(deviceNode.Attributes["X"].Value), Convert.ToInt32(deviceNode.Attributes["Y"].Value), Convert.ToInt32(deviceNode.Attributes["Width"].Value), Convert.ToInt32(deviceNode.Attributes["Height"].Value)); deviceList.Add(deviceConfig); } devices.Add(deviceClass.Attributes["Name"].Value, deviceList); } }
private void ReadDevices(XmlDocument doc) { XmlNode devicesNode = doc.GetElementsByTagName("Devices")[0]; foreach (XmlNode deviceClass in devicesNode.ChildNodes) { List <DeviceConfig> deviceList = new List <DeviceConfig>(); foreach (XmlNode deviceNode in deviceClass.ChildNodes) { DeviceConfig deviceConfig = new DeviceConfig(Convert.ToInt32(deviceNode.Attributes["DeviceNo"].Value), Convert.ToInt32(deviceNode.Attributes["X"].Value), Convert.ToInt32(deviceNode.Attributes["Y"].Value), Convert.ToInt32(deviceNode.Attributes["Width"].Value), Convert.ToInt32(deviceNode.Attributes["Height"].Value)); deviceList.Add(deviceConfig); } devices.Add(deviceClass.Attributes["Name"].Value, deviceList); } }