当前位置: 首页>>代码示例>>C#>>正文


C# UserSession.deleteVariable方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:rowan84,项目名称:BibleApp,代码行数:12,代码来源:ChooseSearchTypeHandler.cs

示例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);
     }
 }
开发者ID:rowan84,项目名称:BibleApp,代码行数:15,代码来源:NotifMessageSendHandler.cs

示例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);
 }
开发者ID:rowan84,项目名称:BibleApp,代码行数:21,代码来源:VerseMessageSendHandler.cs

示例4: init

 public override void init(UserSession us)
 {
     if (us.getVariableObject("Browse.verse_section") != null)
     {
         us.deleteVariable("Browse.verse_section");
     }
 }
开发者ID:rowan84,项目名称:BibleApp,代码行数:7,代码来源:Verse_Handler.cs

示例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);
        }
开发者ID:rowan84,项目名称:BibleApp,代码行数:75,代码来源:Verse_Handler.cs


注:本文中的MxitTestApp.UserSession.deleteVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。