示例#1
0
 public override bool Equals(object obj)
 {
     if (obj is UserChannelCombo)
     {
         UserChannelCombo other = (UserChannelCombo)obj;
         return(other.channelId.Equals(channelId) && other.userId.Equals(userId));
     }
     else
     {
         return(false);
     }
 }
示例#2
0
        internal void AddOrReplaceActiveMenu(ulong userId, ulong channelId, IMenuHandlerObject menuHandlerObject)
        {
            UserChannelCombo userChannelCombo = new UserChannelCombo(userId, channelId);

            if (this.activeMenus.ContainsKey(userChannelCombo))
            {
                this.activeMenus[userChannelCombo] = menuHandlerObject;
            }
            else
            {
                this.activeMenus.Add(new UserChannelCombo(userId, channelId), menuHandlerObject);
            }
        }
示例#3
0
        public object HandleResponse(ulong userId, ulong channelId, MessageContext messageContext)
        {
            UserChannelCombo   userChannelCombo  = new UserChannelCombo(userId, channelId);
            IMenuHandlerObject menuHandlerObject = activeMenus[userChannelCombo];

            object responseObject;

            if (menuHandlerObject.HandleMenuOperation(out responseObject, messageContext))
            {
                if (menuHandlerObject.DeleteAfterResponse)
                {
                    menuHandlerObject.ResponseSentArgs.Delete();
                }
                activeMenus.Remove(userChannelCombo);
                return(responseObject);
            }
            else
            {
                return(null);
            }
        }