Esempio n. 1
0
        protected virtual void OnDataObjectRequested(DataObjectRequestEventArgs eventArgs)
        {
            EventHandler handler = DataObjectRequested;

            if (handler != null)
            {
                handler(this,eventArgs);
            }
        }
Esempio n. 2
0
        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);
        }
        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;
        }
 protected virtual void OnDataObjectRequested( DataObjectRequestEventArgs eventArgs )
 {
     EventHandler handler = DataObjectRequested;
     if (handler != null) handler(this, eventArgs);
 }