예제 #1
0
        public IItem Clone(IRoboDK connectionLink)
        {
            var item      = new Item((RoboDK)connectionLink, this.ItemId, this._type);
            var itemProxy = connectionLink.ItemInterceptFunction(item);

            return(itemProxy);
        }
예제 #2
0
        public RoboDKEventListener(IRoboDK rdk)
        {
            _rdk = rdk;
            _rdk.EventsListen();

            _stopListener        = false;
            _eventListenerThread = new Thread(EventListenerThread);
            _eventListenerThread.Start();
        }
예제 #3
0
        public static void StopRoboDkInstance()
        {
            lock (Lock)
            {
                if (_roboDk != null)
                {
                    _roboDk.CloseRoboDK();
                    _roboDk.Process.WaitForExit(1000);
                    _roboDk = null;
                }
            }

            var roboDKInstances = Process.GetProcessesByName("RoboDK");

            roboDKInstances.Should().BeEmpty("For a successful unit test all existing RoboDK instances must be closed.");
        }
예제 #4
0
        public static IRoboDK StartNewRoboDkInstance()
        {
            lock (Lock)
            {
                if (_roboDk == null)
                {
                    var roboDKInstances = Process.GetProcessesByName("RoboDK");
                    roboDKInstances.Should().BeEmpty("For a successful unit test all existing RoboDK instances must be closed.");
                }
                else
                {
                    _roboDk.CloseRoboDK();
                    _roboDk.Process.WaitForExit(1000);
                    _roboDk = null;
                }

                _roboDk = new RoboDK();
                _roboDk.Connect().Should().BeTrue();
                return(_roboDk);
            }
        }
예제 #5
0
 public void Test_Initialize()
 {
     _roboDk = RoboDkProcessHelper.GetExistingRoboDkOrStartNewIfItDoesNotExist();
     _roboDk.CloseStation();
 }
예제 #6
0
 internal RoboDKEventSource(IRoboDK roboDk)
 {
     _roboDkApiConnection = (RoboDK)roboDk;
     _roboDkEventConnection = (RoboDK)_roboDkApiConnection.CloneRoboDkConnection(RoboDK.ConnectionType.Event);
 }