本文整理汇总了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);
}
}