72 lines
1.5 KiB
C#
72 lines
1.5 KiB
C#
///
|
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using TBF.Rig;
|
|
using TBF.Resources;
|
|
|
|
namespace TBF.Rig.Operations
|
|
{
|
|
public class LargeMessageBoxOp : IOperation
|
|
{
|
|
LargeMessageBoxForm form;
|
|
|
|
string message;
|
|
Color backColor;
|
|
bool completed = false;
|
|
|
|
/// <returns>Reference to the operation</returns>
|
|
public LargeMessageBoxOp()
|
|
: this(Strings.Message)
|
|
{
|
|
}
|
|
|
|
public LargeMessageBoxOp(string message)
|
|
: this (message, Color.LightSteelBlue)
|
|
{
|
|
}
|
|
|
|
public LargeMessageBoxOp(string message, Color backColor)
|
|
{
|
|
this.message = message;
|
|
this.backColor = backColor;
|
|
}
|
|
|
|
delegate void MessageBoxFormDlgt(LargeMessageBoxOp myRef);
|
|
///
|
|
void OpenFormDlg(LargeMessageBoxOp myRef)
|
|
{
|
|
myRef.form = new LargeMessageBoxForm(message, backColor);
|
|
form.Show();
|
|
}
|
|
|
|
/// <summary>Start this operation</summary>
|
|
public void Start()
|
|
{
|
|
completed = false;
|
|
Program.MainWnd.Invoke(new MessageBoxFormDlgt(OpenFormDlg), this);
|
|
}
|
|
|
|
/// <summary>Run this operation</summary>
|
|
/// <returns>Event.ResultsPrinted</returns>
|
|
public Event Run()
|
|
{
|
|
if (form.CompletedContinue) return Event.Continue;
|
|
if (form.CompletedAbort) return Event.Abort;
|
|
return Event.None;
|
|
}
|
|
|
|
/// <summary>Stop this operation</summary>
|
|
public void Stop()
|
|
{
|
|
if (form != null)
|
|
{
|
|
form.OnCloseThisForm(this, null);
|
|
form = null;
|
|
}
|
|
}
|
|
}
|
|
}
|