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


C# UserSession.deleteFavouriteSelection方法代碼示例

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


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

示例1: handleFavouriteDeleteLink

        /*this method either returns the new screen id or the main or prev command string*/
        protected InputHandlerResult handleFavouriteDeleteLink(
            UserSession user_session,
            string input,
            List<MenuOptionItem> menu_options)
        {
            string curr_user_page = user_session.current_menu_loc;
            String entry = input.ToUpper();
            if (entry.StartsWith(DEL_PREFIX))
            {
                String index = entry.Replace(DEL_PREFIX, "");
                int delete_index = -1;
                if (!Int32.TryParse(index, out delete_index))
                {
                    return new InputHandlerResult(
                        "The entry could not be deleted. You entered an invalid ID to delete."); //invalid choice
                }
                delete_index = delete_index - 1;
                if (delete_index < 0 || delete_index >= menu_options.Count())
                {
                    return new InputHandlerResult(
                        "The index you requested to be deleted is out of range. "); //invalid choice
                }

                VerseMenuOptionItem fvmo = (VerseMenuOptionItem) menu_options[delete_index];
                if (fvmo == null)
                {
                    return new InputHandlerResult(
                       "Your entry could not be deleted."); //invalid choice
                }
                user_session.deleteFavouriteSelection(((FavouriteVerseRecord)fvmo.fvr).id);
                return new InputHandlerResult(
                        "Your favourite verse entry has been deleted"); //invalid choice
            }
            else
            {
                return new InputHandlerResult(
                    InputHandlerResult.UNDEFINED_MENU_ACTION,
                    InputHandlerResult.DEFAULT_MENU_ID,
                    InputHandlerResult.DEFAULT_PAGE_ID);
            }
        }
開發者ID:rowan84,項目名稱:BibleApp,代碼行數:42,代碼來源:Favourite_Verse_Menu_Handler.cs


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