예제 #1
0
        /// <summary> Sends all commands currently on queue. </summary>
        private void SendCommandFromQueue()
        {
            CommandStrategy commandStrategy;

            lock (Queue)
            {
                commandStrategy = Queue.Count != 0 ? Queue.Peek() : null;
                // Process command specific dequeue strategy
                if (commandStrategy != null)
                {
                    commandStrategy.DeQueue();
                }

                // Process all generic dequeue strategies
                foreach (var generalStrategy in GeneralStrategies)
                {
                    generalStrategy.OnDequeue();
                }
            }
            // Send command
            if (commandStrategy != null && commandStrategy.Command != null)
            {
                CmdMessenger.ExecuteSendCommand((SendCommand)commandStrategy.Command, ClearQueue.KeepQueue);
            }
        }