public override void Validate() { ValidationStatus = ValidationStatus.Pending; var notValidatedList = mRequestResponseList.Where(item => ValidationStatus.Pending == item.ValidationStatus).ToList(); for (int i = 0; i < notValidatedList.Count; ++i) { ApplicationStatus.SetProgress(i * 100 / notValidatedList.Count); notValidatedList[i].Validate(); if (null != OnPairValidated) { int exactIndex = mRequestResponseList.IndexOf(notValidatedList[i]); OnPairValidated(this, new ElementEventArgs(exactIndex)); } } RemoveDeviceSpecificCommands(); ValidationStatus = (mRequestResponseList.All(item => ValidationStatus.Passed == item.ValidationStatus)) ? ValidationStatus.Passed : ValidationStatus.Failed; Validated = true; }
public override void Validate() { Validated = false; foreach (var conversation in mConversations.ToList()) { ApplicationStatus.SetProgress(0); ApplicationStatus.SetStatus(String.Format("Validating conversation: {0}", conversation.Name)); conversation.Validate(); ApplicationStatus.SetProgress(100); if (conversation.IsEmpty) { mConversations.Remove(conversation); } if (null != OnConversationValidated) { OnConversationValidated(this, new ElementEventArgs(mConversations.IndexOf(conversation))); } } Validated = true; if (null != OnConversationListValidated) { OnConversationListValidated(this, new EventArgs()); } }
private void OnTestingCompleted(object sender, EventArgs eventArgs) { ApplicationStatus.SetProgress(100); ApplicationStatus.SetStatus("Done"); BeginInvoke(new Action(() => { mTestTrees.ToList().ForEach(item => item.CollapseNotSupportedGroups()); btnClear.Enabled = true; })); }
protected void OnProgressChanged(object sender, EventArgs e) { var workerSender = sender as Worker; if (null == workerSender) { return; } int progress = workerSender.Progress; ApplicationStatus.SetProgress(progress); }
/// <summary> /// Start Testing button handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btnStartTesting_Click(object sender, EventArgs e) { if (NetworkTraceSet.LoadedTraces.All(item => NetworkTraceStatus.Parsed == item.Status)) { return; } btnStartTesting.Enabled = false; var traces = NetworkTraceSet.LoadedTraces.Where(item => NetworkTraceStatus.Parsed != item.Status).ToList(); await Task.Run(() => { foreach (var trace in traces) { ApplicationStatus.SetProgress(0); trace.Status = NetworkTraceStatus.InProgress; UpdateTracesList(); var parser = new NTParser(CTTSettings.GetProtocols(), trace); parser.OnProgressChanged += OnProgressChanged; trace.Parser = parser; parser.Run(); trace.Status = NetworkTraceStatus.Parsed; UpdateTracesList(); ApplicationStatus.SetProgress(100); } }, mTokenSource.Token); UpdateUnitList(); ApplicationStatus.SetStatus("Parsing process has been completed."); await Task.Run(() => { ConversationList.Instance.Validate(); ApplicationStatus.SetStatus("Done!"); StateManager.SetState(ApplicationState.Idle); }); }
private void OnTestingStarted(object sender, EventArgs eventArgs) { BeginInvoke(new Action(() => btnClear.Enabled = false)); ApplicationStatus.SetProgress(0); }