/// <summary>
/// Perform the action on the thread the <see cref="Control"/> was created.
/// </summary>
/// <param name="control"></param>
/// <param name="action"></param>
public static void InvokeIfRequired( this Control control, Action action ) {
if ( control.InvokeRequired ) {
control.BeginInvoke( action );
}
else {
action();
}
}
No comments:
Post a Comment