Refactoring : TestBenchFramework --> TBF ver. 2.18.789
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Operations
|
||||
{
|
||||
public class AskYesNoOp : IOperation
|
||||
{
|
||||
AskYesNoForm modelessDlg;
|
||||
|
||||
string question;
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public AskYesNoOp()
|
||||
: this(Strings.Question)
|
||||
{
|
||||
}
|
||||
|
||||
public AskYesNoOp(string question)
|
||||
{
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
delegate void AskYesNoFormDlgt(AskYesNoOp myRef);
|
||||
///
|
||||
void OpenFormDlg(AskYesNoOp myRef)
|
||||
{
|
||||
myRef.modelessDlg = new AskYesNoForm(question);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
Program.MainWnd.Invoke(new AskYesNoFormDlgt(OpenFormDlg), this);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (modelessDlg.CompletedYes) return Event.Yes;
|
||||
if (modelessDlg.CompletedNo) return Event.No;
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
modelessDlg = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user