mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-29 16:51:18 +13:00
24 lines
571 B
C#
24 lines
571 B
C#
// <copyright file="FormsExtensions.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace 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();
|
|
}
|
|
}
|
|
}
|
|
}
|