当前位置: 首页>>代码示例>>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;未经允许,请勿转载。