Ejemplo n.º 1
0
 /// <summary>
 /// Deserializes xml markup from file into an TestAdapterDescription object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output TestAdapterDescription 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 TestAdapterDescription obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(TestAdapterDescription);
     try
     {
         obj = LoadFromFile(fileName);
         return(true);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Deserializes workflow markup into an TestAdapterDescription object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output TestAdapterDescription 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 TestAdapterDescription obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(TestAdapterDescription);
     try
     {
         obj = Deserialize(input);
         return(true);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
        private object GetDataObject()
        {
            var eventArgs = new DataObjectRequestEventArgs();
            OnDataObjectRequested( eventArgs );
            object data = null;
            if (_instrumentDescription != null)
                data = _instrumentDescription;
            else if (_testStationDescription != null)
                data = _testStationDescription;
            else if (_testAdapterDescription != null)
                data = _testAdapterDescription;

            if (data == null)
            {
                if (eventArgs.ObjectItemDescription is InstrumentDescription)
                    data = _instrumentDescription = eventArgs.ObjectItemDescription as InstrumentDescription;
                else if (eventArgs.ObjectItemDescription is TestAdapterDescription1 )
                    data = _testAdapterDescription = eventArgs.ObjectItemDescription as TestAdapterDescription1;
                else if (eventArgs.ObjectItemDescription is TestStationDescription11 )
                    data = _testStationDescription = eventArgs.ObjectItemDescription as TestStationDescription11;
            }

            return data;
        }
Ejemplo n.º 4
0
 public static bool LoadFromFile(string fileName, out TestAdapterDescription obj)
 {
     System.Exception exception;
     return(LoadFromFile(fileName, out obj, out exception));
 }
Ejemplo n.º 5
0
 public static bool Deserialize(string input, out TestAdapterDescription obj)
 {
     System.Exception exception;
     return(Deserialize(input, out obj, out exception));
 }
 public static bool LoadFromFile(string fileName, out TestAdapterDescription obj)
 {
     System.Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an TestAdapterDescription object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output TestAdapterDescription 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 TestAdapterDescription obj, out System.Exception exception)
 {
     exception = null;
     obj = default(TestAdapterDescription);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string input, out TestAdapterDescription obj)
 {
     System.Exception exception;
     return Deserialize(input, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an TestAdapterDescription object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output TestAdapterDescription 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 TestAdapterDescription obj, out System.Exception exception)
 {
     exception = null;
     obj = default(TestAdapterDescription);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 /**
  * Called when the Hardware Description is a Test Adapter.
  */
 private void ProcessTestAdapterPath( TestAdapterDescription testAdapterDescription )
 {
     Capabilities capabilities = testAdapterDescription.Capabilities;
     TestEquipmentTerminalBlocks terminalBlocks = testAdapterDescription.TerminalBlocks;
     ProcessCapabilitites( capabilities );
     if (!CapabilitiesOnly)
     {
         ProcessTerminalBlocks( terminalBlocks );
         ProcessHardwareItemSwitching( testAdapterDescription.Switching );
     }
 }