Sicherung
This commit is contained in:
24
FSI.BT.Tools/SystemTrayMenu/Utilities/FormsExtensions.cs
Normal file
24
FSI.BT.Tools/SystemTrayMenu/Utilities/FormsExtensions.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
// <copyright file="FormsExtensions.cs" company="PlaceholderCompany">
|
||||
// Copyright (c) PlaceholderCompany. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace FSI.BT.Tools.SystemTrayMenu.Utilities
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
internal static class FormsExtensions
|
||||
{
|
||||
public static void HandleInvoke(this Control instance, Action action)
|
||||
{
|
||||
if (instance.InvokeRequired)
|
||||
{
|
||||
instance.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user