public void SendCommands( object sender, ICKReadOnlyList<string> commands )
{
if( _runningCommands == null ) _runningCommands = new Queue<DictionaryEntry>();
bool isRunning = _runningCommands.Count > 0;
foreach( string cmd in commands )
_runningCommands.Enqueue( new DictionaryEntry( sender, cmd ) );
if( !isRunning )
{
while( _runningCommands.Count > 0 )
{
DictionaryEntry e = _runningCommands.Dequeue();
DoSendCommand( e.Key, (string)e.Value );
}
}
}