mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-10-01 01:27:33 +13:00
25 lines
571 B
C#
25 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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|