public void AddTransaction(string tType, IStepModel step, IStepService stepService, String stepName = "", String parentTransactionName = "")
        {
            try
            {
                var fc = new FunctionCall();
                var fcs = new FunctionCallSignature { Name = tType};

                //check if the step is already predefined. This is in case of surrounding web_concurrent_start and web_concurrent_end
                //String name = (stepName == "") ? tNumber + ". " + step.ComposedName : tNumber + ". " + stepName;

                fcs.Parameters.Add(new FunctionCallParameter(stepName, ParameterType.ArgtypeString));
                //if we are adding lr_start_sub_transaction add the parent transaction name
                if (tType.Contains("start_sub"))
                    fcs.Parameters.Add(new FunctionCallParameter(parentTransactionName, ParameterType.ArgtypeNumber));

                //if we are adding lr_end_transaction add the LR_AUTO parameter
                if (tType.Contains("end"))
                    fcs.Parameters.Add(new FunctionCallParameter("LR_AUTO", ParameterType.ArgtypeNumber));

                fc.Signature = fcs;
                fc.Location = new FunctionCallLocation(step.FunctionCall.Location.FilePath, null, null);
                IStepModel newStep = stepService.GenerateStep(fc);

                RelativeStep relativity = (tType.Contains("start")) ? RelativeStep.Before : RelativeStep.After;

                if (tType.Contains("end"))
                    tNumber++;

                stepService.AddStep(ref newStep, step, relativity, false);
            }
            catch (Exception ex)
            {
                MessageService.ShowMessage(string.Format(ex.StackTrace));
            }
        }
        public bool SetSelectedSteps(IStepService stepService, ITextEditor editor)
        {
            try
            {
                firstSelectedStep = stepService.CurrentStep;
                lastSelectedStep = stepService.CurrentStep;

                //Check if we have selected more than 1 step, then we'll find the first and last selected steps
                if (editor.SelectionLength > 0)
                {
                    int selectionStart = editor.SelectionStart;
                    int selectionEnd = editor.SelectionStart + editor.SelectionLength;

                    editor.Caret.Offset = selectionEnd;
                    //Get the last selected line
                    int lastSelectedLine = editor.Caret.Line;

                    //Move the cursor to the start of selection to find out the line of the first step
                    editor.Caret.Offset = selectionStart;
                    //Get the first selected line
                    int firstSelectedLine = editor.Caret.Line;

                    //Check if the line contains a step. If it doesn't move the line down the script
                    //until we find a step or we reach the selection end
                    firstSelectedStep = GetLastSelectedStep(lastSelectedLine, false);
                    //Move the cursor to the end of selection to find out the end line
                    editor.Caret.Offset = selectionEnd;
                    //Check if the line contains a step. If it doesn't move the line up the script
                    //until we reach the selection start
                    lastSelectedStep = GetLastSelectedStep(firstSelectedLine, true);
                }

                if (firstSelectedStep == null && lastSelectedStep == null)
                    return false;
                return true;
            }
            catch (Exception ex)
            {
                MessageService.ShowMessage(ex.Message);
                Log.VuGen.Error(string.Format("Error occurred when searching for selected step, (Type: '{0}', Exception: '{1}')", Owner.GetType(), ex));
                return false;
            }
        }
예제 #3
0
 public StepsController(IStepService stepService)
 {
     _stepService = stepService;
 }
예제 #4
0
 public StepController(IStepService service, IMapper mapper, IFacadeFilter filter)
 {
     Mapper  = mapper;
     Service = service;
     Filter  = filter;
 }
예제 #5
0
 public MainPageViewModel(INavigationService navigationService, IStepService stepService) : base(navigationService)
 {
     Title        = "Wonder";
     _stepService = stepService;
 }
예제 #6
0
 public StepController(
     IServiceProvider serviceProvider,
     IStepService stepService) : base(serviceProvider)
 {
     this.stepService = stepService;
 }
예제 #7
0
 public StepController(IStepService stepService)
 {
     this.stepService = stepService;
 }