The Labs \ Source Viewer \ SSCLI \ System.ComponentModel \ ISynchronizeInvoke

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ISynchronizeInvoke.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.ComponentModel
  16. {
  17.     using System;
  18.     using System.Security.Permissions;
  19.    
  20.     /// <devdoc>
  21.     /// <para>Provides a way to synchronously or asynchronously execute a delegate.</para>
  22.     /// </devdoc>
  23.     public interface ISynchronizeInvoke
  24.     {
  25.        
  26.         /// <devdoc>
  27.         /// <para>Gets a value indicating whether the caller must call <see cref='System.ComponentModel.ISynchronizeInvoke.Invoke'/> when calling an object that implements
  28.         /// this interface.</para>
  29.         /// </devdoc>
  30.         bool InvokeRequired {
  31.             get;
  32.         }
  33.        
  34.         /// <devdoc>
  35.         /// <para>
  36.         /// Executes the given delegate on the main thread that this object executes on.</para>
  37.         /// </devdoc>
  38.         [HostProtection(Synchronization = true, ExternalThreading = true)]
  39.         IAsyncResult BeginInvoke(Delegate method, object[] args);
  40.        
  41.         /// <devdoc>
  42.         /// <para>Waits until the process you started by
  43.         /// calling <see cref='System.ComponentModel.ISynchronizeInvoke.BeginInvoke'/> completes, and then returns
  44.         /// the value generated by the process.</para>
  45.         /// </devdoc>
  46.         object EndInvoke(IAsyncResult result);
  47.        
  48.         /// <devdoc>
  49.         /// <para>
  50.         /// Executes the given delegate on the main thread that this object
  51.         /// executes on.</para>
  52.         /// </devdoc>
  53.         object Invoke(Delegate method, object[] args);
  54.     }
  55. }

Developer Fusion