コード例 #1
0
        public StepStatus SetStepValue(int sourceParameter, int stepNumber)
        {
            bool valid = true;

            foreach (ControlledParameterTemplate template in controlledParameters.Where(x => x.ControllerParameter == sourceParameter))
            {
                //See if any steps fail
                valid &= template.CouldStepTo(stepNumber);
            }

            if (!valid)
            {
                //Report failure to step
                return(StepStatus.OutOfBounds);
            }

            StepStatus valueStatus = StepStatus.Success;

            foreach (ControlledParameterTemplate template in controlledParameters.Where(x => x.ControllerParameter == sourceParameter))
            {
                valueStatus |= template.StepTo(stepNumber);
            }

            return(valueStatus);
        }
コード例 #2
0
        public void RunStepMethod()
        {
            if (this._status != StepStatus.WaitingRun)
            {
                throw new PXException(TX.Error.INVALID_STEP_STATUS_RUNNING_STEPMETHOD, this.Name);
            }

            this._status = StepStatus.Running;

            if (this.ParentJob.Canceled == true)
            {
                return;
            }

            try
            {
                this.StepMethod(this.Parm);
            }
            catch (Exception e)
            {
                this.SetStepError(e, this._status);

                if (e is ThreadAbortException)
                {
                    throw e;
                }
            }
        }
コード例 #3
0
ファイル: StepButton.cs プロジェクト: mind0n/hive
		public StepButton()
		{
			FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			Status = StepStatus.Inactive;
			TabStop = false;
			GotFocus += new EventHandler(StepButton_GotFocus);
			Enabled = false;
		}
コード例 #4
0
ファイル: _Step.cs プロジェクト: rameshkooragayala/CI_Build
 internal void Start()
 {
     this.Status = StepStatus.RUNNING;
     if (DoStart != null)
     {
         DoStart(this, new EventArgs());
     }
 }
コード例 #5
0
ファイル: _Step.cs プロジェクト: rameshkooragayala/CI_Build
 internal void Fail()
 {
     this.Status = StepStatus.FAILED;
     if (DoFail != null)
     {
         DoFail(this, new EventArgs());
     }
 }
コード例 #6
0
ファイル: _Step.cs プロジェクト: rameshkooragayala/CI_Build
 internal void Pass()
 {
     this.Status = StepStatus.PASSED;
     if (DoPass != null)
     {
         DoPass(this, new EventArgs());
     }
 }
コード例 #7
0
ファイル: _Step.cs プロジェクト: rameshkooragayala/CI_Build
 internal void Skip()
 {
     this.Status = StepStatus.SKIPPED;
     if (DoSkip != null)
     {
         DoSkip(this, new EventArgs());
     }
 }
コード例 #8
0
ファイル: _Step.cs プロジェクト: rameshkooragayala/CI_Build
 internal void Abort()
 {
     this.Status = StepStatus.ABORTED;
     if (DoAbort != null)
     {
         DoAbort(this, new EventArgs());
     }
 }
コード例 #9
0
ファイル: _Step.cs プロジェクト: rameshkooragayala/CI_Build
 internal void Play()
 {
     this.Status = StepStatus.RESUMED;
     if (DoPlay != null)
     {
         DoPlay(this, new EventArgs());
     }
 }
コード例 #10
0
ファイル: _Step.cs プロジェクト: rameshkooragayala/CI_Build
 internal void Pause()
 {
     this.Status = StepStatus.PAUSED;
     if (DoPause != null)
     {
         DoPause(this, new EventArgs());
     }
 }
コード例 #11
0
ファイル: a.cs プロジェクト: smithmx/continuous_improvement
        public static IContainerStatus container_status_with(int step, StepStatus status)
        {
            var mock = new Mock <IContainerStatus>();

            mock.SetupGet(_ => _.IsBuildContainer).Returns(true);
            mock.SetupGet(_ => _.Step).Returns(new StepId(step, 0, "test"));
            mock.SetupGet(_ => _.Status).Returns(status);
            return(mock.Object);
        }
コード例 #12
0
        /// <summary>
        /// This method is used to create the station information
        /// </summary>
        /// <param name="name">The name</param>
        /// <param name="toArrival">To arrival</param>
        /// <param name="toDistance">To distance</param>
        /// <returns>Date time</returns>
        public TrainStationModel CreateStationInfo(string name, string toArrival, double toDistance)
        {
            DateTime dateTimeArr;

            DateTime toStartTime;

            if (DateTime.TryParse("7:00:00 AM", out toStartTime))
            {
                // Do Nothing
            }

            DateTime toEndTime;

            if (DateTime.TryParse("7:00:00 PM", out toEndTime))
            {
                // Do Nothing
            }

            StepStatus currentStatus = StepStatus.NotStarted;

            if (DateTime.TryParse(toArrival, out dateTimeArr))
            {
                // Do Nothing
            }

            dateTimeArr = this.SetTrainTiming(dateTimeArr);

            if (this.lastStationStatus == StepStatus.Completed)
            {
                currentStatus = StepStatus.InProgress;
            }

            if (dateTimeArr <= DateTime.Now)
            {
                currentStatus = StepStatus.Completed;
            }

            this.lastStationStatus = currentStatus;

            var station = new TrainStationModel()
            {
                Name              = name,
                Arrival           = dateTimeArr.TimeOfDay.ToString().Remove(5),
                Departure         = dateTimeArr.AddMinutes(2).TimeOfDay.ToString().Remove(5),
                ArrivalDateTime   = dateTimeArr,
                DepartureDateTime = dateTimeArr.AddMinutes(2),
                Distance          = "Station at " + toDistance.ToString(CultureInfo.CurrentCulture) + " km",
                Status            = currentStatus,
            };

            if (station.Status == StepStatus.Completed)
            {
                station.ProgressedDistance = 100;
            }

            return(station);
        }
コード例 #13
0
 public Step(string name, StepProcessingType processingType, Job parentJob)
 {
     this.Name                  = name;
     this._processingType       = processingType;
     this.ParentJob             = parentJob;
     this._status               = StepStatus.WaitingRun;
     this.StepMethod            = null;
     this.CheckStepResultMethod = null;
 }
コード例 #14
0
        public void SubmitTrialResult(bool correct)
        {
            ++trial;

            int stepDiff = 0;

            if (correct)
            {
                incorrectCount = 0;

                if (++correctCount >= CorrectToStepDown)
                {
                    stepDiff = GetStepDownSize();
                }
            }
            else
            {
                correctCount = 0;

                if (++incorrectCount >= WrongToStepUp)
                {
                    stepDiff = -1 * GetStepUpSize();
                }
            }

            if (stepDiff != 0)
            {
                if (lastStep != 0 && (stepDiff > 0) != (lastStep > 0))
                {
                    if (InFinalReversalStage())
                    {
                        reversalValues.Add(stepValue);
                    }

                    reversals++;
                }

                if (lastStep != 0 || stepDiff > 0)
                {
                    lastStep = stepDiff;
                }

                StepStatus stepStatus = SetStepValue(0, stepValue + stepDiff);

                if (stepStatus == StepStatus.Success)
                {
                    stepValue     += stepDiff;
                    correctCount   = 0;
                    incorrectCount = 0;
                }
                else
                {
                    ++reversals;
                }
            }
        }
コード例 #15
0
        public Station CreateStationInfo(string name, string toArrrival, double toDistance, string froArrrival, int index, double froDistance = 0)
        {
            DateTime dateTimeArr;

            DateTime toStartTime;

            DateTime.TryParse("7:00:00 AM", CultureInfo.InvariantCulture.DateTimeFormat, DateTimeStyles.None, out toStartTime);
            DateTime toEndTime;

            DateTime.TryParse("7:00:00 PM", CultureInfo.InvariantCulture.DateTimeFormat, DateTimeStyles.None, out toEndTime);

            StepStatus currentStatus = StepStatus.NotStarted;

            DateTime.TryParse(toArrrival, CultureInfo.InvariantCulture.DateTimeFormat, DateTimeStyles.None, out dateTimeArr);
            dateTimeArr = SetTrainTiming(dateTimeArr);

            if (lastStationStatus == StepStatus.Completed)
            {
                currentStatus = StepStatus.InProgress;
            }
            if (dateTimeArr <= DateTime.Now)
            {
                currentStatus = StepStatus.Completed;
            }

            lastStationStatus = currentStatus;

            station = new Station()
            {
                Name             = name,
                Arrival          = dateTimeArr.TimeOfDay.ToString().Remove(5),
                Depature         = dateTimeArr.AddMinutes(2).TimeOfDay.ToString().Remove(5),
                ArrivalDateTime  = dateTimeArr,
                DepatureDateTime = dateTimeArr.AddMinutes(2),
                Distance         = "Station at " + toDistance.ToString() + " Miles",
                Status           = currentStatus
            };

            if (station.Status == StepStatus.Completed)
            {
                station.ProgressedDistance = 100;
            }
            else if (station.Status == StepStatus.InProgress)
            {
                CalcuateProgressedPercentage(dateTimeArr, station, index);
            }
            else
            {
                station.ProgressedDistance = 0;
            }

            previousStationDepaturedTime = dateTimeArr.AddMinutes(2);

            return(station);
        }
コード例 #16
0
        /// <summary>
        /// Gets the next step in the creation process.
        /// </summary>
        /// <param name="current">The current (just executed step)</param>
        /// <param name="previousStatus">Whether the current step passed or failed</param>
        /// <returns>The next step in the character creation process, or null if it is finished</returns>
        public override CharacterCreationSubState GetNextStep(CharacterCreationSubState current, StepStatus previousStatus)
        {
            // If there is no state yet, set up the initial character creation state.
            if (current == null)
            {
                return new ConfirmCreationEntryState(this.Session);
            }

            // Otherwise either go forward to the next state, or back to the previous state if requested.
            return previousStatus == StepStatus.Success ? this.AdvanceState(current) : this.RegressState(current);
        }
        public void Test()
        {
            var gpsMock = new GpsMock();

            gpsMock.SetSteps(5000);

            var service = new PhoneService(new ConnectionMock(), gpsMock, null);

            StepStatus met = service.NumberOfStepsMet();

            Assert.AreEqual(met, StepStatus.Met);
        }
コード例 #18
0
ファイル: StepInfo.cs プロジェクト: BEXIS2/Core
 /// <summary>
 /// 
 /// </summary>
 /// <remarks></remarks>
 /// <seealso cref=""/>
 /// <param name="title"></param>            
 public StepInfo(string title)
 {
     this.title = title;
     this.parentTitle = "";
     this.stepStatus = StepStatus.none;
     this.GetActionInfo = new ActionInfo();
     this.PostActionInfo = new ActionInfo();
     this.Children = new List<StepInfo>();
     this.HasContent = true;
     this.IsInstanze = true;
     this.Expand = false;
 }
コード例 #19
0
 /// <summary>
 ///
 /// </summary>
 /// <remarks></remarks>
 /// <seealso cref=""/>
 /// <param name="title"></param>
 public StepInfo(string title)
 {
     this.title          = title;
     this.parentTitle    = "";
     this.stepStatus     = StepStatus.none;
     this.GetActionInfo  = new ActionInfo();
     this.PostActionInfo = new ActionInfo();
     this.Children       = new List <StepInfo>();
     this.HasContent     = true;
     this.IsInstanze     = true;
     this.Expand         = false;
 }
コード例 #20
0
        public Step CreateStepInfo(string description, StepStatus status, int progress, string taskDescription)
        {
            Step step = new Step()
            {
                Description     = description,
                Status          = status,
                ProgressValue   = progress,
                TaskDescription = taskDescription
            };

            return(step);
        }
コード例 #21
0
        /// <summary>
        /// Processes the next step in the character creation chain, or completes
        /// the process if there are no more steps.
        /// </summary>
        /// <param name="step">The current step</param>
        /// <param name="result">The result of the current step</param>
        public void HandleNextStep(CharacterCreationSubState step, StepStatus result)
        {
            this.CurrentStep = this.GetNextStep(step, result);

            // If there were no remaining steps found, we're done.
            if (this.CurrentStep == null)
            {
                this.OnCreationComplete();
                return;
            }

            this.CurrentStep.StateMachine = this;
            this.Session.WritePrompt();
        }
コード例 #22
0
ファイル: Dashboard.cs プロジェクト: anathiswaphi/Automation
 public static void LogStepStatus(StepStatus stepStatus, string Message)
 {
     try
     {
         StepCount++;
         Status status = (Status)stepStatus;
         scenario.Log(status, Message);
         Console.WriteLine(StepCount);
     }
     catch (Exception stepexception)
     {
         throw new Exception(stepexception.Message);
     }
 }
コード例 #23
0
        /// <summary>
        /// Method to select the template based on status and index.
        /// </summary>
        /// <param name="item">stepview item.</param>
        /// <param name="container">step progress bar.</param>
        /// <returns>data template.</returns>
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            StepViewItem stepViewItem = item as StepViewItem;

            if (stepViewItem != null)
            {
                ItemsControl itemsControl = ItemsControl.ItemsControlFromItemContainer(stepViewItem);
                int          index        = itemsControl.ItemContainerGenerator.IndexFromContainer(stepViewItem);
                StepStatus   stepStatus   = stepViewItem.Status;
                stepViewItem.MarkerWidth  = 50;
                stepViewItem.MarkerHeight = 50;
                if (stepStatus == StepStatus.Inactive && index == 0)
                {
                    return(stepViewItem.FindResource("InactiveFirstStepTemplate") as DataTemplate);
                }
                else if (stepStatus == StepStatus.Indeterminate && index == 0)
                {
                    return(stepViewItem.FindResource("IndeterminateFirstStepTemplate") as DataTemplate);
                }
                else if (stepStatus == StepStatus.Active && index == 0)
                {
                    return(stepViewItem.FindResource("ActiveFirstStepTemplate") as DataTemplate);
                }
                else if (stepStatus == StepStatus.Inactive && index == 1)
                {
                    return(stepViewItem.FindResource("InactiveSecondStepTemplate") as DataTemplate);
                }
                else if (stepStatus == StepStatus.Indeterminate && index == 1)
                {
                    return(stepViewItem.FindResource("IndeterminateSecondStepTemplate") as DataTemplate);
                }
                if (stepStatus == StepStatus.Active && index == 1)
                {
                    return(stepViewItem.FindResource("ActiveSecondStepTemplate") as DataTemplate);
                }
                else if (stepStatus == StepStatus.Inactive && index == 2)
                {
                    return(stepViewItem.FindResource("InactiveThirdStepTemplate") as DataTemplate);
                }
                else if (stepStatus == StepStatus.Indeterminate && index == 2)
                {
                    return(stepViewItem.FindResource("IndeterminateThirdStepTemplate") as DataTemplate);
                }
                else if (stepStatus == StepStatus.Active && index == 2)
                {
                    return(stepViewItem.FindResource("ActiveThirdStepTemplate") as DataTemplate);
                }
            }
            return(null);
        }
コード例 #24
0
        /// <summary>Processes the next step in the character creation chain, or completes the process if there are no more steps.</summary>
        /// <param name="step">The current step</param>
        /// <param name="result">The result of the current step</param>
        public void HandleNextStep(CharacterCreationSubState step, StepStatus result)
        {
            this.CurrentStep = this.GetNextStep(step, result);

            // If there were no remaining steps found, we're done.
            if (this.CurrentStep == null)
            {
                this.OnCreationComplete();
                return;
            }

            this.CurrentStep.StateMachine = this;
            this.Session.WritePrompt();
        }
コード例 #25
0
        public void OnStepMethodCompleted()
        {
            if (this._status != StepStatus.Running)
            {
                throw new PXException(TX.Error.INVALID_STEP_STATUS_RUNNING_ONSTEPMETHODCOMPLETED, this.Name);
            }

            if (this.CheckStepResultMethod != null)
            {
                this.CheckStepResultMethod(this.Parm);
            }

            this._status = StepStatus.Done;
        }
コード例 #26
0
        public void ChangeStatus(StepStatus newStatus)
        {
            if (status == newStatus)
            {
                return;
            }

            status = newStatus;
            EventHandler handler = StatusChanged;

            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }
コード例 #27
0
        public void Test()
        {
            var gpsMock = new GpsMock();

            gpsMock.SetSteps(5000);

            var service = new PhoneServiceBuilder()
                          .WithConnection(new ConnectionMock())
                          .WithGps(gpsMock)
                          .Build();

            StepStatus met = service.NumberOfStepsMet();

            Assert.AreEqual(StepStatus.Met, met);
        }
コード例 #28
0
        public void SetStepError(Exception e, StepStatus newStatus)
        {
            if (this._status != StepStatus.WaitingRun &&
                this._status != StepStatus.Running)
            {
                throw new PXException(TX.Error.INVALID_STEP_STATUS_RUNNING_SETERROR, this.Name);
            }

            this._status = newStatus;

            if (this.Parm.Exception == null)
            {
                this.Parm.Exception = e;
            }
        }
コード例 #29
0
ファイル: AddStep.cs プロジェクト: waldo2590/Rock
        /// <summary>
        /// Gets the step status.
        /// </summary>
        /// <param name="stepType">Type of the step.</param>
        /// <param name="action">The action.</param>
        /// <param name="errorMessage">The error message.</param>
        /// <returns></returns>
        private StepStatus GetStepStatus(StepType stepType, WorkflowAction action, out string errorMessage)
        {
            errorMessage = string.Empty;
            StepStatus stepStatus      = null;
            var        stepStatusValue = GetLavaAttributeValue(action, AttributeKey.StepProgramStepStatus);

            if (stepType == null || stepType.StepProgram == null || stepType.StepProgram.StepStatuses == null)
            {
                errorMessage = "The step type is required to include the step program and statuses";
                return(null);
            }

            // Check if the value is a guid. This method works for stepProgram|stepStatus or simply just step status guid
            StepProgramStepStatusFieldType.ParseDelimitedGuids(stepStatusValue, out var unused2, out var stepStatusGuid);

            if (stepStatusGuid.HasValue)
            {
                stepStatus = stepType.StepProgram.StepStatuses.FirstOrDefault(ss => ss.Guid == stepStatusGuid.Value);

                if (stepStatus == null)
                {
                    errorMessage = $"The step status with the guid '{stepStatusGuid.Value}' was not found in '{stepType.StepProgram.Name}'";
                    return(null);
                }
            }

            // Try to get a step status with a step status id
            if (stepStatus == null)
            {
                var stepStatusId = stepStatusValue.AsIntegerOrNull();

                if (!stepStatusId.HasValue)
                {
                    errorMessage = "The step status identifier is required but was missing";
                    return(null);
                }

                stepStatus = stepType.StepProgram.StepStatuses.FirstOrDefault(ss => ss.Id == stepStatusId.Value);

                if (stepStatus == null)
                {
                    errorMessage = $"The step status with the id '{stepStatusId.Value}' was not found in '{stepType.StepProgram.Name}'";
                    return(null);
                }
            }

            return(stepStatus);
        }
コード例 #30
0
        private StepStatus AddStepStatusToStepProgram(StepProgram program, Guid guid, string name, bool isCompleteStatus, string colorCode, int order)
        {
            var newStatus = new StepStatus();

            newStatus.Guid             = guid;
            newStatus.Name             = name;
            newStatus.IsActive         = true;
            newStatus.Order            = order;
            newStatus.IsCompleteStatus = isCompleteStatus;
            newStatus.StatusColor      = colorCode;
            newStatus.ForeignKey       = _SampleDataForeignKey;

            program.StepStatuses.Add(newStatus);

            return(newStatus);
        }
コード例 #31
0
        /// <summary>
        /// Gets the next step in the creation process.
        /// </summary>
        /// <param name="current">
        /// The current (just executed step)
        /// </param>
        /// <param name="previousStatus">
        /// Whether the current step passed or failed
        /// </param>
        /// <returns>
        /// The next step in the character creation process, or null if it is finished
        /// </returns>
        public override CharacterCreationSubState GetNextStep(CharacterCreationSubState current, StepStatus previousStatus)
        {
            // entry point of the state machine
            if (current == null)
            {
                return new ConfirmCreationEntryState(this.Session);
            }

            if (previousStatus == StepStatus.Success)
            {
                return this.AdvanceState(current);
            }
            else
            {
                return this.RegressState(current);
            }
        }
コード例 #32
0
        /// <summary>Processes the next step in the character creation chain, or completes the process if there are no more steps.</summary>
        /// <param name="step">The current step.</param>
        /// <param name="result">The result of the current step.</param>
        public void HandleNextStep(CharacterCreationSubState step, StepStatus result)
        {
            CurrentStep = GetNextStep(step, result);

            // If there were no remaining steps found, we're done.
            if (CurrentStep == null)
            {
                OnCreationComplete();
                return;
            }
            else
            {
                CurrentStep.Begin();
            }

            CurrentStep.StateMachine = this;
        }
コード例 #33
0
        void stepReadyTimer_Tick(object sender, EventArgs e)
        {
            stepReadyTimer.Stop();
            StepStatus stepStatus = _parentForm.GetStepStatus();

            if (stepStatus == StepStatus.Ready)
            {
                _parentForm.Controls["btnNext"].Visible       = true;
                _parentForm.Controls["btnNext"].Enabled       = true;
                _parentForm.Controls["btnNewSession"].Enabled = true;
            }
            else
            {
                stepReadyTimer.Interval = interval;
                stepReadyTimer.Start();
                System.Windows.Forms.Application.DoEvents();
            }
        }
コード例 #34
0
        private ConsoleColor Colorize(StepStatus status)
        {
            switch (status)
            {
            case StepStatus.None:
                return(ConsoleColor.Gray);

            case StepStatus.InProgress:
                return(ConsoleColor.White);

            case StepStatus.Failed:
                return(ConsoleColor.Red);

            case StepStatus.Complete:
                return(ConsoleColor.Green);

            default: throw new ArgumentException("Unknown value was received.", "status");
            }
        }
コード例 #35
0
        public StepStatus GetStepStatus()
        {
            StepStatus stepStatus = StepStatus.NotReady;

            try
            {
                WebRequest             request    = HttpWebRequest.Create(string.Format("{0}/GetStepState?sessionID={1}", _baseUri, Session));
                WebResponse            response   = request.GetResponse();
                DataContractSerializer serializer = new DataContractSerializer(typeof(StepStatus));
                using (XmlReader reader = XmlReader.Create(response.GetResponseStream()))
                {
                    stepStatus = (StepStatus)serializer.ReadObject(reader, false);
                }
            }
            catch (Exception ex)
            {
                stepStatus = StepStatus.NotReady;
            }

            return(stepStatus);
        }
コード例 #36
0
ファイル: Notifier.cs プロジェクト: wurdum/deployer
 private ConsoleColor Colorize(StepStatus status)
 {
     switch (status) {
         case StepStatus.None:
             return ConsoleColor.Gray;
         case StepStatus.InProgress:
             return ConsoleColor.White;
         case StepStatus.Failed:
             return ConsoleColor.Red;
         case StepStatus.Complete:
             return ConsoleColor.Green;
         default: throw new ArgumentException("Unknown value was received.", "status");
     }
 }
コード例 #37
0
        private void OpenTab(StepStatus stepStatus)
        {
            if (stepStatus == StepStatus.Init) return;
            var openNewDocStep = this.actions.Steps["OpenDocumentTab"];
            var openClinicalStep = this.actions.Steps["OpenClinicalTab"];
            var openImageStep = this.actions.Steps["OpenImageTab"];
            if (this.account == AccountTypes.Admin)
            {
                var script = File.ReadAllText(Path.Combine("Scripts", openNewDocStep.Script));
                this.webView.ExecuteScriptAsync(script);
            }

            if (this.account == AccountTypes.Clinical)
            {
                var script = File.ReadAllText(Path.Combine("Scripts", openClinicalStep.Script));
                this.webView.ExecuteScriptAsync(script);
            }

            if (this.account == AccountTypes.Image)
            {
                var script = File.ReadAllText(Path.Combine("Scripts", openImageStep.Script));
                this.webView.ExecuteScriptAsync(script);
            }

            this.currentStatus = stepStatus;
        }
コード例 #38
0
        private void WebViewOnFrameLoadEnd(object sender, FrameLoadEndEventArgs frameLoadEndEventArgs)
        {
            DataFile file = null;
            this.Invoke(new Action(() => { file = this.lstCategory.SelectedItem as DataFile; }));

            this.webView.ExecuteScriptAsync(Resources.RunTime);
            try
            {
                if (file == null)
                {
                    throw new NullReferenceException("Selected file is null");
                }

                foreach (var step in this.actions.Steps)
                {
                    if (frameLoadEndEventArgs.Url.Contains(step.Value.FrameUrlKey) && this.currentStatus == step.Value.PreStatus)
                    {
                        var scriptFile = step.Value.Script.Replace(@"{Parameter}", file.Parameter);
                        var script = File.ReadAllText(Path.Combine("Scripts", scriptFile));

                        if (step.Value.HasData)
                        {
                            if (step.Value.DataIncrease) currentIndex++;
                            if (currentIndex >= selectedRows.Count)
                            {
                                this.CloseLoading();
                                return;
                            }

                            var row = selectedRows[currentIndex];
                            script = this.selectedColumns.Aggregate(script, (c, column) => c.Replace("{" + column + "}", row[column].ToString()));
                            script = script.Replace(@"{Status}", file.ModifyStep.ToString());
                            script = script.Replace(@"{Parameter}", file.Parameter);
                        }

                        this.webView.EvaluateScriptAsync(script).Wait();
                        this.currentStatus = step.Value.NextStatus;
                    }
                }
            }
            catch (Exception)
            {
                this.CloseLoading();
                throw;
            }
        }
コード例 #39
0
        private void WebViewOnLoginFrameLoadEnd(object sender, FrameLoadEndEventArgs frameLoadEndEventArgs)
        {
            if (Settings.Default.DebugTool)
            {
                this.webView.ShowDevTools();
            }

            // Only for development, auto enter user name and password
            if (frameLoadEndEventArgs.Url.Contains("login/ssoLogin"))
            {
                this.webView.ExecuteScriptAsync("document.getElementById('form').scrollIntoView(false);");
                if (Settings.Default.AutoTextUserName)
                {
                    this.webView.ExecuteScriptAsync(File.ReadAllText(Path.Combine("Scripts", "Login.js")));
                }

                this.Invoke(
                    new Action(() => this.CmbAccountSelectedIndexChanged(this.cmbAccount, new EventArgs())));
                this.currentStatus = 0; // Initialize
            }
            else if (frameLoadEndEventArgs.Url.Contains(this.actions.Steps["Login"].FrameUrlKey))
            {
                this.webView.EvaluateScriptAsync(Resources.RunTime).Wait();
                var step = this.actions.Steps["Login"];
                var script = File.ReadAllText(Path.Combine("Scripts", step.Script));
                this.webView.EvaluateScriptAsync(script).Wait();
            }
        }
コード例 #40
0
ファイル: StepInfo.cs プロジェクト: BEXIS2/Core
 /// <summary>
 /// 
 /// </summary>
 /// <remarks></remarks>
 /// <seealso cref=""/>
 /// <param name="status"></param>
 public void SetStatus(StepStatus status)
 {
     this.stepStatus = status;
 }
コード例 #41
0
 /// <summary>
 /// Gets the next step.
 /// </summary>
 /// <param name="current">The current.</param>
 /// <param name="previousStatus">The previous status.</param>
 /// <returns></returns>
 public abstract CharacterCreationSubState GetNextStep(CharacterCreationSubState current, StepStatus previousStatus);