public DeviceManagerSettings(ApplicationSettings root, XmlElement element) : base(root, element) { ApplicationSettings = (ApplicationSettings)root; SerialPort = null; _DeviceGroupName = new GenericSetting<String>("", this, "DeviceGroupName"); _Enabled = new GenericSetting<bool>(true, this, "Enabled"); _Name = new GenericSetting<String>("", this, "Name"); String deviceGroupName = DeviceGroupName; DeviceGroup = ApplicationSettings.DeviceManagementSettings.GetDeviceGroup(deviceGroupName); ProtocolSettings = ApplicationSettings.DeviceManagementSettings.GetProtocol(DeviceGroup.Protocol); LoadDetails(); }
private void LoadSerialPort() { _UsesSerialPort = null; // forces refer back tp protocol for this info if (UsesSerialPort) { XmlElement serial = GetElement("serialport"); if (serial != null) SerialPort = new PVSettings.SerialPortSettings(ApplicationSettings, serial); else { serial = AddElement(settings, "serialport"); SerialPort = new PVSettings.SerialPortSettings(ApplicationSettings, serial); } } else SerialPort = null; }