Ejemplo n.º 1
0
        /// <summary> Synchronized send a command. </summary>
        /// <param name="sendCommand">    The command to sent. </param>
        /// <param name="sendQueueState"> Property to optionally clear/wait the send queue. </param>
        /// <returns> . </returns>
        public ReceivedCommand SendCommandSync(SendCommand sendCommand, SendQueue sendQueueState)
        {
            // Directly call execute command
            var resultSendCommand = _sender.ExecuteSendCommand(sendCommand, sendQueueState);

            InvokeNewLineEvent(NewLineSent, new NewLineEvent.NewLineArgs(sendCommand));
            return(resultSendCommand);
        }
Ejemplo n.º 2
0
 /// <summary> Sends a float command from the queue. </summary>
 /// <param name="commandStrategy"> The command strategy to send. </param>
 private void SendSingleCommandFromQueue(CommandStrategy commandStrategy)
 {
     // Dequeue
     lock (Queue)
     {
         commandStrategy.DeQueue();
         // Process all generic dequeue strategies
         foreach (var generalStrategy in GeneralStrategies)
         {
             generalStrategy.OnDequeue();
         }
     }
     // Send command
     if (commandStrategy != null && commandStrategy.Command != null)
     {
         _sender.ExecuteSendCommand((SendCommand)commandStrategy.Command, SendQueue.InFrontQueue);
     }
 }