本文整理汇总了C#中MxitTestApp.UserSession.recordFavouriteSelection方法的典型用法代码示例。如果您正苦于以下问题:C# UserSession.recordFavouriteSelection方法的具体用法?C# UserSession.recordFavouriteSelection怎么用?C# UserSession.recordFavouriteSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MxitTestApp.UserSession
的用法示例。
在下文中一共展示了UserSession.recordFavouriteSelection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: handleFavouriteLinks
protected InputHandlerResult handleFavouriteLinks(
UserSession us,
string input)
{
if (ADD_TO_FAV.Equals(input.Trim().ToUpper()))
{
VerseSection vs = (VerseSection)us.getVariableObject("Browse.verse_section");
if (vs == null)
{
return new InputHandlerResult(
InputHandlerResult.UNDEFINED_MENU_ACTION,
InputHandlerResult.DEFAULT_MENU_ID,
InputHandlerResult.DEFAULT_PAGE_ID);
}
Verse start_verse = vs.start_verse;
if (start_verse == null)
{
return new InputHandlerResult(
InputHandlerResult.UNDEFINED_MENU_ACTION,
InputHandlerResult.DEFAULT_MENU_ID,
InputHandlerResult.DEFAULT_PAGE_ID);
}
Verse end_verse = vs.end_verse;
if (us.favourite_verses.isFavouriteListFull())
{
return new InputHandlerResult(
"Your favourite list is full. Please first delete an existing favourite verse"); //invalid choice
}
int output = us.recordFavouriteSelection(start_verse, end_verse);
if(output == FavouriteVerseManager.FAVOURITE_VERSE_ADDED_SUCCCESS)
{
//end verse should never be null
String verse_ref = BibleHelper.getVerseSectionReferenceWithoutTranslation(start_verse, end_verse);
return new InputHandlerResult(
InputHandlerResult.FAVOURITE_ADDED_ACTION,
us.current_menu_loc,
verse_ref + " has been added to your favourites"); //invalid choice
}else if(output == FavouriteVerseManager.FAVOURITE_ALREADY_ADDED)
{
return new InputHandlerResult(
"This is already a favourite. You can't add duplicate favourites."); //invalid choice
}
}
else if (SEND_TO_BUDDY.Equals(input.Trim().ToUpper()))
{
return new InputHandlerResult(
InputHandlerResult.NEW_MENU_ACTION,
MenuIDConstants.SEND_VERSE_MESSAGE_ID,
InputHandlerResult.DEFAULT_PAGE_ID);
}
else if (TAG_VERSE.Equals(input.Trim().ToUpper()))
{
return new InputHandlerResult(
InputHandlerResult.NEW_MENU_ACTION,
MenuIDConstants.TAG_VERSE_ID,
InputHandlerResult.DEFAULT_PAGE_ID);
}
else if (".".Equals(input.Trim().ToUpper()))
{
VerseSection vs = (VerseSection)us.getVariableObject("Browse.verse_section");
if (vs == null)
{
Console.WriteLine("Expected Browse.verse_section present, but not found");
return new InputHandlerResult(
InputHandlerResult.UNDEFINED_MENU_ACTION,
InputHandlerResult.DEFAULT_MENU_ID,
InputHandlerResult.DEFAULT_PAGE_ID);
}
String verse_ref = BibleHelper.getVerseSectionReferenceWithoutTranslation(vs.start_verse, vs.end_verse);
return handleDirectVerseInput(us, verse_ref);
}
return new InputHandlerResult(
InputHandlerResult.UNDEFINED_MENU_ACTION,
InputHandlerResult.DEFAULT_MENU_ID,
InputHandlerResult.DEFAULT_PAGE_ID);
}