System.Windows.Threading.Dispatcher.BeginInvoke C# (CSharp) Method

BeginInvoke() public method

public BeginInvoke ( Delegate d ) : System.Windows.Threading.DispatcherOperation
d System.Delegate
return System.Windows.Threading.DispatcherOperation
		public DispatcherOperation BeginInvoke (Delegate d, params object[] args)
		{
			DispatcherOperation op = null;
			lock (queuedOperations) {
				op = new DispatcherOperation (d, args);
				queuedOperations.Enqueue (op);
				if (!pending) {
					if (callback == null)
						callback = new TickCallHandler (dispatcher_callback);
					NativeMethods.time_manager_add_dispatcher_call (NativeMethods.surface_get_time_manager (surface.Native),
					                                                   callback, IntPtr.Zero);
					pending = true;
				}
			}
			return op;
		}

Same methods

Dispatcher::BeginInvoke ( System.Action a ) : System.Windows.Threading.DispatcherOperation

Usage Example

示例#1
0
        public static bool Verify(Dispatcher dispatcher, Stream file)
        {
            if (file.Length == 0)
            {
                dispatcher.BeginInvoke(() =>
                    MessageBox.Show(Resources.EmptyFile,
                        Properties.Resources.DownloadTitle,
                        MessageBoxButton.OK));

                return false;
            }

            if (!DatabaseReader.CheckSignature(file))
            {
                dispatcher.BeginInvoke(() =>
                    MessageBox.Show(Resources.NotKdbx,
                        Properties.Resources.DownloadTitle,
                        MessageBoxButton.OK));

                return false;
            }

            file.Position = 0;
            return true;
        }
All Usage Examples Of System.Windows.Threading.Dispatcher::BeginInvoke