示例#1
0
        /// <summary>
        /// This method creates a new queue if queue and adds it to the dictionary
        /// </summary>
        /// <param name="convId"></param>
        public void CreateQueue(Tuple <Guid, short> convId)
        {
            Logger.InfoFormat("Creating new queue for conversation: {0} {1}", convId.Item1, convId.Item2);
            EnvelopeQueue newQueue = new EnvelopeQueue();

            EnvelopeQueueDict.Add(convId, newQueue);
        }
示例#2
0
        /// <summary>
        /// This method returns the queue associated with a given conversation Id
        /// </summary>
        /// <param name="convId"></param>
        /// <returns></returns>
        public EnvelopeQueue GetConversation(Tuple <Guid, short> convId)
        {
            Logger.InfoFormat("Getting queue for conversation: {0} {1}", convId.Item1, convId.Item2);
            EnvelopeQueue queue = null;

            if (EnvelopeQueueDict.TryGetValue(convId, out queue))
            {
                return(queue);
            }
            else
            {
                CreateQueue(convId);
                return(EnvelopeQueueDict[convId]);
            }
        }