protected override void OnExecute()
        {
            using (Traffic.AcquireLock())
            {
                Traffic.Clear();
            }
            ErrorText = String.Empty;

            try
            {
                /*var commandDocument = XDocument.Parse(UserCommandText);
                 *
                 * var cookie = string.Empty;
                 * var cookieAttribute = commandDocument.Root.Attribute("Cookie");
                 * if (cookieAttribute != null)
                 * {
                 *  cookie = cookieAttribute.Value;
                 * }*/

                EventAggregatorContext.Current.GetEvent <SendDataEvent>().Publish(new SendDataEventArgs(UserCommandText, this, string.Empty));
            }
            catch (Exception exception)
            {
                ErrorText = exception.Message;
            }
        }
        /// <summary>
        /// We are being asked to disconnect from Cornerstone.
        /// </summary>
        private void OnDisconnect()
        {
            using (Traffic.AcquireLock())
            {
                Traffic.Clear();
            }

            if (Connected)
            {
                _communicationEngine.Disconnect();
                Connected = false;
            }
        }
        protected virtual void OnExecute()
        {
            using (Traffic.AcquireLock())
            {
                Traffic.Clear();
            }
            ErrorText = String.Empty;

            if (CurrentCommand != null)
            {
                var commandDocument = CurrentCommand.GetCommand();
                EventAggregatorContext.Current.GetEvent <SendDataEvent>().Publish(new SendDataEventArgs(commandDocument.ToString(), this, CurrentCommand.Cookie));
            }
        }
Beispiel #4
0
        protected override void OnExecute()
        {
            using (Traffic.AcquireLock())
            {
                Traffic.Clear();
            }
            ErrorText = String.Empty;

            try
            {
                var commandDocument = XDocument.Parse(UserCommandText);
                EventAggregatorContext.Current.GetEvent <SendDataEvent>().Publish(new SendDataEventArgs(commandDocument, this));
            }
            catch (Exception exception)
            {
                ErrorText = exception.Message;
            }
        }