Common.Forms.ModelessForm modifications.
This commit is contained in:
parent
2c6e5d3367
commit
401828d4c6
@ -1,4 +1,7 @@
|
|||||||
using System;
|
///
|
||||||
|
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@ -53,20 +56,20 @@ namespace Common.Forms
|
|||||||
public event EventHandler<MessageEventArgs> UpdateMessageHandler;
|
public event EventHandler<MessageEventArgs> UpdateMessageHandler;
|
||||||
void OnUpdateMessage(object sender, MessageEventArgs args)
|
void OnUpdateMessage(object sender, MessageEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Message != null) label1.Text = args.Message;
|
if (args != null && args.Message != null) label1.Text = args.Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called from the state machine when an operation forces a modeless dialog close.
|
/// Called from the state machine when an operation forces a modeless dialog close.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void CloseForm()
|
public void CloseForm()
|
||||||
{
|
{
|
||||||
if (CloseFormHandler == null) return;
|
if (CloseFormHandler == null) return;
|
||||||
try { CloseFormHandler(null, null); }
|
try { CloseFormHandler(null, null); }
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
static public event EventHandler<EventArgs> CloseFormHandler;
|
public event EventHandler<EventArgs> CloseFormHandler;
|
||||||
void OnCloseForm(object sender, EventArgs args)
|
void OnCloseForm(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
DialogResult = DialogResult.Cancel;
|
DialogResult = DialogResult.Cancel;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user