コード例 #1
0
        private Menu ConfirmDeleteSession(CallbackQuery callback)
        {
            Menu menu;
            var  sessionId = SessionIdFromCallbackData(callback.data);
            var  session   = GetSessionById(sessionId);

            if (session == null)
            {
                menu = new NoMatchingSessionMenu(sessionId);
            }
            else
            {
                menu = new DeleteSessionConfirmMenu(session);
            }

            return(menu);
        }
コード例 #2
0
        private Menu MarkSessionLive(CallbackQuery callback)
        {
            Menu menu;
            var  sessionId = SessionIdFromCallbackData(callback.data);
            var  session   = GetSessionById(sessionId);

            if (session == null)
            {
                menu = new NoMatchingSessionMenu(sessionId);
            }
            else
            {
                session.MarkLive();
                _database.SaveSession(session);
                menu = new SessionCompleteLiveMenu();
            }

            return(menu);
        }
コード例 #3
0
        private Menu DeleteSession(CallbackQuery callback)
        {
            Menu menu;
            var  sessionId = SessionIdFromCallbackData(callback.data);
            var  session   = GetSessionById(sessionId);

            if (session == null)
            {
                menu = new NoMatchingSessionMenu(sessionId);
            }
            else
            {
                _sessions.Remove(session);
                _database.RemoveSession(session);
                menu = new DeleteSessionConfirmedMenu();
            }

            return(menu);
        }