Little cleanup (extension method for BeginInvoke).
This commit is contained in:
parent
1d7e9bd80a
commit
c81bb3e50e
|
@ -32,9 +32,15 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions
|
|||
}
|
||||
|
||||
// extension method to make Control.Invoke easier to use
|
||||
public static void Invoke(this Control control, Action action)
|
||||
public static object Invoke(this Control control, Action action)
|
||||
{
|
||||
control.Invoke(action);
|
||||
return control.Invoke(action);
|
||||
}
|
||||
|
||||
// extension method to make Control.BeginInvoke easier to use
|
||||
public static IAsyncResult BeginInvoke(this Control control, Action action)
|
||||
{
|
||||
return control.BeginInvoke(action);
|
||||
}
|
||||
|
||||
public static void AddColumn(this ListView listView, string columnName, bool enabled, int columnWidth)
|
||||
|
|
|
@ -70,10 +70,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateChecker.CheckComplete += (s2, e2) =>
|
||||
{
|
||||
if (IsDisposed) return;
|
||||
BeginInvoke((MethodInvoker)(() =>
|
||||
{
|
||||
UpdateNotification.Visible = UpdateChecker.IsNewVersionAvailable;
|
||||
}));
|
||||
this.BeginInvoke(() => { UpdateNotification.Visible = UpdateChecker.IsNewVersionAvailable; });
|
||||
};
|
||||
UpdateChecker.BeginCheck(); // Won't actually check unless enabled by user
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue