mirror of
https://github.com/psforever/GameLauncher.git
synced 2026-01-19 18:24:45 +00:00
24 lines
535 B
C#
24 lines
535 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace PSLauncher
|
|
{
|
|
public static class ISynchronizeInvokeExtensions
|
|
{
|
|
public static void SafeInvoke<T>(this T @this, Action<T> action) where T : ISynchronizeInvoke
|
|
{
|
|
if (@this.InvokeRequired)
|
|
{
|
|
@this.Invoke(action, new object[] { @this });
|
|
}
|
|
else
|
|
{
|
|
action(@this);
|
|
}
|
|
}
|
|
}
|
|
}
|