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