コード例 #1
0
        public static StepCollection AddCommandWithParameter(this Step step, string command, ILocalizedString suggestParameterText)
        {
            var commandWithParameter      = new CommandStep(command, true);
            var commandWithoutOfParameter = new CommandStep(command, false);

            commandWithoutOfParameter.EchoReply(suggestParameterText, EchoOptions.EchoForceReply());
            var commandAwaitParameter = commandWithoutOfParameter.AddAnyInput();

            step.AddChildStep(commandWithParameter);
            step.AddChildStep(commandWithoutOfParameter);
            return(new StepCollection(new[] { commandWithParameter, commandAwaitParameter }));
        }
コード例 #2
0
        /// <summary>
        ///     это добавит автоматический input
        /// </summary>
        public static Step AddDelegateInput(this Step step, Func <CallContext, string> act)
        {
            var executorStep = new AutomaticStep(act);

            step.AddChildStep(executorStep);
            return(executorStep);
        }
コード例 #3
0
        public static Step AddPhotoInput(this Step step)
        {
            var photoStep = new PhotoStep();

            step.AddChildStep(photoStep);
            return(photoStep);
        }
コード例 #4
0
        public static Step AddAnyInput(this Step step)
        {
            var anyInputStep = new AnyInputStep();

            step.AddChildStep(anyInputStep);
            return(anyInputStep);
        }
コード例 #5
0
        public static Step AddQueryResult(this Step step)
        {
            var commandStep = new QueryResultStep();

            step.AddChildStep(commandStep);
            return(commandStep);
        }
コード例 #6
0
        public static Step AddCommand(this Step step, string command, bool acceptParameter = false)
        {
            var commandStep = new CommandStep(command, acceptParameter);

            step.AddChildStep(commandStep);
            return(commandStep);
        }