private void NewDevicebutton_Click(object sender, EventArgs e) { AnalyzerInterface.DeviceDef NewDevice = new AnalyzerInterface.NWTCompatibleDeviceDef(); DeviceArray.Add(NewDevice); DeviceListMenuRefresh(); DevicesComboBox.SelectedItem = NewDevice; DeviceProperyGrid.SelectedObject = NewDevice; }
private void LoadAvailablesDeviceDef() { DirectoryInfo d = new DirectoryInfo(Program.DeviceDefPath); FileInfo[] Files = d.GetFiles("*.def"); //Getting Text files // unserialize device definition for (int i = 0; i < Files.Length; i++) { XmlSerializer xs = new XmlSerializer(typeof(AnalyzerInterface.NWTCompatibleDeviceDef)); using (StreamReader wr = new StreamReader(System.IO.Path.Combine(Program.DeviceDefPath, Files[i].ToString()))) { DeviceArray.Add(xs.Deserialize(wr) as AnalyzerInterface.NWTCompatibleDeviceDef); } } }