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); } }
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); } }
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); } }