Posted by David Srbecky Sat 20th Jan 2007 16:18 - Syntax is C# - 20 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
-
static void BeginInvokePendingCommands(Control control)
-
{
-
// Force control to create handle
-
if (control.Handle == IntPtr.Zero) {
-
throw System.Exception("No handle");
-
}
-
control.BeginInvoke((MethodInvoker)delegate {
-
if (pendingCommands.Count > 0) {
-
// Remove one command from list
-
MethodInvoker command = pendingCommands.First.Value;
-
pendingCommands.RemoveFirst();
-
// Perform the command
-
command();
-
// Invoke the rest of the commands
-
BeginInvokePendingCommands(control);
-
} else {
-
Console.WriteLine("No commands to perform");
-
}
-
Application.DoEvents();
-
});
-
}
PermaLink to this entry https://pastebin.co.uk/9368
Posted by David Srbecky Sat 20th Jan 2007 16:18 - Syntax is C# - 20 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers