コード例 #1
0
 void AddActionToQueue(SkypeAction message)
 {
     lock (_locker)
     {
         _skypeActions.Enqueue(message);
     }
 }
コード例 #2
0
        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;
                }
            }
        }