protected override void ControlsToData() { if (_bus == null) _bus = new VXI(); base.ControlsToData(); var vxi = (VXI) _bus; vxi.interruptLines = (int) edtInteruptLines.Value; vxi.requiredMemory = edtRequiredMemory.GetValue<string>(); vxi.slotWeight = (double) edtSlotWeight.Value; vxi.manufacturerID = edtMfgId.GetValue<string>(); vxi.modelCode = edtModelCode.GetValue<string>(); vxi.slots = (int) edtSlots.Value; vxi.dynamicallyConfigured = chkDynamicConfig.Checked; vxi.deviceCategory = (DeviceCategory) Enum.Parse(typeof (DeviceCategory), (string) cmbDeviceCategory.SelectedItem); vxi.slotSize = (VXISlotSize) Enum.Parse(typeof (VXISlotSize), (string) cmbSlotSize.SelectedItem); vxi.addressSpace = (VXIAddressSpace) Enum.Parse(typeof (VXIAddressSpace), (string) cmbVXIAddressSpace.SelectedItem); vxi.deviceClass = (VXIDeviceClass) Enum.Parse(typeof (VXIDeviceClass), (string) cmbVXIDeviceClass.SelectedItem); vxi.DynamicCurrent = vxiDynamicCurrentControl.VXIBackplaneVoltages; vxi.ECLTrigger = vxiECLTriggerControl.VXITriggerLines; vxi.Keying = vxiKeyingControl.VXIKeying; vxi.ModuleCooling = vxiModuleCoolingControl.VXIModuleCooling; vxi.PeakCurrent = vxiPeakCurrentControl.VXIBackplaneVoltages; vxi.TTLTrigger = vxiTTLTriggerControl.VXITriggerLines; vxi.SupportedClockSources = supportedClockSourcesControl.SupportedClockSources; }
public static bool LoadFromFile(string fileName, out VXI obj) { Exception exception; return LoadFromFile(fileName, out obj, out exception); }
/// <summary> /// Deserializes xml markup from file into an VXI object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output VXI object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out VXI obj, out Exception exception) { exception = null; obj = default(VXI); try { obj = LoadFromFile(fileName); return true; } catch (Exception ex) { exception = ex; return false; } }
public static bool Deserialize(string input, out VXI obj) { Exception exception; return Deserialize(input, out obj, out exception); }
/// <summary> /// Deserializes workflow markup into an VXI object /// </summary> /// <param name="input">string workflow markup to deserialize</param> /// <param name="obj">Output VXI object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string input, out VXI obj, out Exception exception) { exception = null; obj = default(VXI); try { obj = Deserialize(input); return true; } catch (Exception ex) { exception = ex; return false; } }