コード例 #1
0
        public static string StatusText(string name, eAdvisorStatus reason)
        {
            DateTime when = DateTime.Now;
            string   text = "";

            switch (reason)
            {
            case eAdvisorStatus.Active:
                text = string.Format("{0} is typing a message", name);
                break;

            case eAdvisorStatus.Ready:
                text = string.Format("{0} is counselling a user", name);
                break;

            case eAdvisorStatus.Hold:
                text = string.Format("{0} is on hold", name);
                break;

            case eAdvisorStatus.Offline:
                text = string.Format("{0} left the chat at {1}", name, when.ToShortTimeString());
                break;

            case eAdvisorStatus.Timeout:
                text = string.Format("{0} left the chat at {1}, due to timeout", name, when.ToShortTimeString());
                break;
            }
            return(text);
        }
コード例 #2
0
        public void AdvisorLeave(Guid advisorID, eAdvisorStatus status)
        {
            if (advisors.ContainsKey(advisorID))
            {
                var advisor = advisors[advisorID];
                var childId = advisor.Child;
                var text = Advisor.StatusText(advisor.Name == advisorID.ToString() ? "Advisor" : advisor.Name, status);
                if (childId.HasValue && children.ContainsKey(childId.Value))
                {
                    AdvisorSay(advisorID, text, eMessageType.Leave);
                    children[childId.Value].Advisor = null;
                }

                advisors.Remove(advisorID);
            }

            if (advisors.Count == 0)
                m_isQueueOpen = false;
        }
コード例 #3
0
        public void AdvisorLeave(Guid advisorID, eAdvisorStatus status)
        {
            if (advisors.ContainsKey(advisorID))
            {
                var advisor = advisors[advisorID];
                var childId = advisor.Child;
                var text    = Advisor.StatusText(advisor.Name == advisorID.ToString() ? "Advisor" : advisor.Name, status);
                if (childId.HasValue && children.ContainsKey(childId.Value))
                {
                    AdvisorSay(advisorID, text, eMessageType.Leave);
                    children[childId.Value].Advisor = null;
                }

                advisors.Remove(advisorID);
            }

            if (advisors.Count == 0)
            {
                m_isQueueOpen = false;
            }
        }
コード例 #4
0
 public static string StatusText(string name, eAdvisorStatus reason)
 {
     DateTime when = DateTime.Now;
     string text = "";
     switch(reason)
     {
         case eAdvisorStatus.Active:
             text = string.Format("{0} is typing a message", name);
             break;
         case eAdvisorStatus.Ready:
             text = string.Format("{0} is counselling a user", name);
             break;
         case eAdvisorStatus.Hold:
             text = string.Format("{0} is on hold", name);
             break;
         case eAdvisorStatus.Offline:
             text = string.Format("{0} left the chat at {1}", name, when.ToShortTimeString());
             break;
         case eAdvisorStatus.Timeout:
             text = string.Format("{0} left the chat at {1}, due to timeout", name, when.ToShortTimeString());
             break;
     }
     return text;
 }