Ejemplo n.º 1
0
 public int AddBus(Bus bus)
 {
     var item = new ListViewItem(bus.GetType().Name);
     item.SubItems.Add(bus.defaultAddress);
     item.Tag = bus;
     return Items.Add(item).Index;
 }
 public static bool LoadFromFile(string fileName, out Bus obj)
 {
     Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an Bus object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output Bus 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 Bus obj, out Exception exception)
 {
     exception = null;
     obj = default(Bus);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string input, out Bus obj)
 {
     Exception exception;
     return Deserialize(input, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an Bus object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output Bus 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 Bus obj, out Exception exception)
 {
     exception = null;
     obj = default(Bus);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Ejemplo n.º 6
0
 private void ControlsToData()
 {
     switch (cmbBusType.SelectedIndex)
     {
         case _EIA232:
             bus = eiA232Control.EIA232;
             break;
         case _Ethernet:
             bus = ethernetControl.Ethernet;
             break;
         case _IEEE488:
             bus = ieeE488Control.IEEE488;
             break;
         case _IEEE1394:
             bus = ieeE1394Control.IEEE1394;
             break;
         case _LXI:
             bus = lxiControl.LXI;
             break;
         case _PCI:
             bus = pciControl.PCI;
             break;
         case _PCIe:
             bus = pcIeControl.PCIe;
             break;
         case _PXI:
             bus = pxiControl.PXI;
             break;
         case _PXIe:
             bus = pxIeControl.PXIe;
             break;
         case _USB:
             bus = usbControl.USB;
             break;
         case _VME:
             bus = vmeControl.VME;
             break;
         case _VXI:
             bus = vxiControl.VXI;
             break;
     }
 }