本文整理汇总了C#中MxitTestApp.UserSession.deleteVariable方法的典型用法代码示例。如果您正苦于以下问题:C# UserSession.deleteVariable方法的具体用法?C# UserSession.deleteVariable怎么用?C# UserSession.deleteVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MxitTestApp.UserSession
的用法示例。
在下文中一共展示了UserSession.deleteVariable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: init
public override void init(UserSession us)
{
//at the moment leaving this variable in the session even if user returns to main menu. We should remove it then also.
if (us.getVariableObject(SearchTestamentHandler.SEARCH_TESTAMENT_VAR_NAME) != null)
{
us.deleteVariable(SearchTestamentHandler.SEARCH_TESTAMENT_VAR_NAME);
}
if (us.getVariableObject(SearchHandler.BOOK_SEARCH_VAR_NAME) != null)
{
us.deleteVariable(SearchHandler.BOOK_SEARCH_VAR_NAME);
}
}
示例2: init
public override void init(UserSession us)
{
if (us.hasVariable(VerseMessageSendOutputAdapter.MESSAGE_SUBJECT))
{
us.deleteVariable(VerseMessageSendOutputAdapter.MESSAGE_SUBJECT);
}
if (us.hasVariable(VerseMessageSendOutputAdapter.FRIEND_TO_SEND_ID))
{
us.deleteVariable(VerseMessageSendOutputAdapter.FRIEND_TO_SEND_ID);
}
if (us.hasVariable(VerseMessageSendOutputAdapter.MESSAGE_TEXT))
{
us.deleteVariable(VerseMessageSendOutputAdapter.MESSAGE_TEXT);
}
}
示例3: init
public override void init(UserSession us)
{
if (us.hasVariable(VerseMessageSendOutputAdapter.MESSAGE_SUBJECT))
{
us.deleteVariable(VerseMessageSendOutputAdapter.MESSAGE_SUBJECT);
}
if (us.hasVariable(VerseMessageSendOutputAdapter.FRIEND_TO_SEND_ID))
{
us.deleteVariable(VerseMessageSendOutputAdapter.FRIEND_TO_SEND_ID);
}
if (us.hasVariable(VerseMessageSendOutputAdapter.MESSAGE_TEXT))
{
us.deleteVariable(VerseMessageSendOutputAdapter.MESSAGE_TEXT);
}
if (us.hasVariable(ChooseFriendHandler.RECIPIENT_LIST))
{
us.deleteVariable(ChooseFriendHandler.RECIPIENT_LIST);
}
if (us.hasVariable(ChooseFriendHandler.RECIPIENT_LIST))
us.removeVariable(ChooseFriendHandler.RECIPIENT_LIST);
}
示例4: init
public override void init(UserSession us)
{
if (us.getVariableObject("Browse.verse_section") != null)
{
us.deleteVariable("Browse.verse_section");
}
}
示例5: handleInput
public override InputHandlerResult handleInput(UserSession user_session, MessageReceived message_recieved)
{
string input = extractReply(message_recieved);
//Console.WriteLine("in input handler: " + input);
Console.WriteLine("User with ID: " + user_session.user_profile.id + " Entered: " + input);
//get reply
string curr_user_page = user_session.current_menu_loc;
InputHandlerResult output = handleStdNavLinks(user_session, input);
if (output.action != (InputHandlerResult.UNDEFINED_MENU_ACTION))
return output;
MenuManager mm = MenuManager.getInstance();
//for now we assume this. must correct this later
VerseMenuPage vmp = (VerseMenuPage)mm.menu_def.getMenuPage(curr_user_page);
List<MenuOptionItem> options = vmp.options;
foreach (MenuOptionItem option in options)
{
if (option.link_val.Equals(input))
return new InputHandlerResult(
InputHandlerResult.NEW_MENU_ACTION,
option.select_action,
InputHandlerResult.DEFAULT_PAGE_ID);
}
//now handle input
input = input.Trim();
if (input.Equals(""))
{
return new InputHandlerResult(
"Invalid entry...Please enter a valid input (e.g. 'John 3:16' or '1 John 1:9' or read the help section for more information"); //invalid choice
}
input = input.Replace('.', ':');
Verse start_verse = null;
Verse end_verse = null;
if (input.Contains('-'))
{
String[] start_end = input.Split('-');
start_verse = getStartingVerse(user_session.user_profile.getDefaultTranslationId(), start_end[0]);
if (start_verse == null)
{
return new InputHandlerResult(
"Invalid entry...Please enter a valid input (e.g. 'John 3:16' or '1 John 1:9'"); //invalid choice
}
if (start_end.Count() >= 2)
{
end_verse = getEndingVerse(user_session.user_profile.getDefaultTranslationId(), start_verse, start_end[1]);
}
}
else
{
start_verse = getStartingVerse(user_session.user_profile.getDefaultTranslationId(), input);
}
user_session.deleteVariable("Browse.verse_section");
try
{
if (end_verse == null)
end_verse = start_verse;
VerseSection vs = new VerseSection(start_verse, end_verse);
user_session.setVariable("Browse.verse_section", vs);
//now this is one big hack
user_session.setVariable("Browse.directSelect", true);
}
catch (XInvalidVerseSection e)
{
return new InputHandlerResult(e.Message); //invalid choice
}
return new InputHandlerResult(
InputHandlerResult.NEW_MENU_ACTION,
vmp.input_item.target_page,
InputHandlerResult.DEFAULT_PAGE_ID);
}