當前位置: 首頁>>代碼示例>>C#>>正文


C# UserSession.hasNewEvent方法代碼示例

本文整理匯總了C#中MxitTestApp.UserSession.hasNewEvent方法的典型用法代碼示例。如果您正苦於以下問題:C# UserSession.hasNewEvent方法的具體用法?C# UserSession.hasNewEvent怎麽用?C# UserSession.hasNewEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MxitTestApp.UserSession的用法示例。


在下文中一共展示了UserSession.hasNewEvent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: getOutputScreenMessage

        public override MessageToSend getOutputScreenMessage(
            UserSession us,
            MenuPage mp,
            MessageToSend ms,
            InputHandlerResult ihr)
        {
            ms.Append(MessageBuilder.Elements.CreateClearScreen());
            if (!mp.GetType().FullName.Equals("MxitTestApp.OptionMenuPage"))//TODO: Should be constant
                throw new Exception("Invalid menu page passed into getScreen method ");

            OptionMenuPage omp = (OptionMenuPage)mp;
            ms.Append(omp.title + "\r\n", TextMarkup.Bold);
            if (ihr.action == InputHandlerResult.INVALID_MENU_ACTION
                && ihr.error != null)
            {
                ms.Append((string)ihr.error + "\r\n");
            }
            else
            {
                ms.Append(parseMessage(us, omp.message) + "\r\n");
            }

            ms.AppendLine("Refer a friend to the BibleApp on MXit by using the link below. ");
            ms.AppendLine(createMessageLink(MENU_LINK_NAME, "Spread The Word", MainMenuHandler.REFER_A_FRIEND));

            ms.AppendLine();

            if (us.user_profile.is_suspended)
            {
                ms.Append("\r\n");
                ms.Append("You have been suspended from this application. Please email us at [email protected]");
                ms.Append("\r\n");
                ms.Append("\r\n");
                return ms;
            }

            if (us.hasVariable(UserSession.GUEST_USER_NAME_ASSIGNED))
            {
                ms.Append("\r\n");
                ms.Append("You have been assigned a guest user name. To remove this message please change your user name in the profile option below.");
                ms.Append("\r\n");
                ms.Append("\r\n");
            }

            if (us.bookmark_manager.bookmark_verse != null)
            {
                ms.Append("To continue reading where you left off ");
                ms.Append(createMessageLink(MENU_LINK_NAME, "Click Here", "BOOKMARK"));
                ms.Append("\r\n");
                ms.Append("\r\n");
                ms.Append("Or choose an option below...\r\n");
            }
            else
            {
                ms.Append("Choose an option below...\r\n");
            }

            List<MenuOptionItem> options = omp.options;
            int count =1 ;
            foreach (MenuOptionItem option in options)
            {
                ms.Append(createMessageLink(MENU_LINK_NAME, count + ") ", option.link_val));
                if (option.menu_option_id == MY_PROFILE_OPTION_ID)
                {
                    if (us.hasNewEvent())
                    {
                        ms.Append(option.display_text + " (!)\r\n", TextMarkup.Bold);
                    }
                    else
                    {
                        ms.Append(option.display_text + "\r\n");
                    }
                }
                else
                {
                    ms.Append(option.display_text + "\r\n");
                }

                count++;
            }
            appendBackMainLinks(us,  ms);
            appendMessageConfig(true, ms);

            ms.AppendLine("");

            ms.AppendLine("");
            ms.AppendLine("Shortcuts...", TextMarkup.Bold);
            ms.Append(createMessageLink(MENU_LINK_NAME, "Inbox", MainMenuHandler.MESSAGE_INBOX));
            if (us.hasNewMessageEvent())
            {
                ms.Append(" (NEW)", TextMarkup.Bold);
            }

            if (us.hasNewFriendRequest())
            {
                ms.Append(" | ");
                ms.Append(createMessageLink(MENU_LINK_NAME, "Buddy Requests", MainMenuHandler.BUDDY_REQUESTS));
                ms.Append(" (NEW)", TextMarkup.Bold);
            }

//.........這裏部分代碼省略.........
開發者ID:rowan84,項目名稱:BibleApp,代碼行數:101,代碼來源:MainMenuScreenOutputAdapter.cs


注:本文中的MxitTestApp.UserSession.hasNewEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。