void AddActionToQueue(SkypeAction message) { lock (_locker) { _skypeActions.Enqueue(message); } }
private void ProcessQueue(object state) { lock (_locker) { if (_skypeActions.Count == 0) { return; } SkypeAction message = _skypeActions.Dequeue(); switch (message.ActionType) { case SkypeActionType.SendMessage: _sendMessageService.SendMessage(message.Contact, message.Message); break; case SkypeActionType.AcceptContact: _sendMessageService.AcceptContact(message.Contact); break; } } }