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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="EventDescriptor.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. /*
  16. */
  17. namespace System.ComponentModel
  18. {
  19.    
  20.     using System;
  21.     using System.Diagnostics;
  22.     using System.Reflection;
  23.     using System.Security.Permissions;
  24.    
  25.     /// <devdoc>
  26.     /// <para>
  27.     /// Provides a description
  28.     /// of an event.
  29.     /// </para>
  30.     /// </devdoc>
  31.     [HostProtection(SharedState = true)]
  32.     [System.Runtime.InteropServices.ComVisible(true)]
  33.     public abstract class EventDescriptor : MemberDescriptor
  34.     {
  35.         /// <devdoc>
  36.         /// <para>
  37.         /// Initializes a new instance of the <see cref='System.ComponentModel.EventDescriptor'/> class with the
  38.         /// specified name and attribute
  39.         /// array.
  40.         /// </para>
  41.         /// </devdoc>
  42.         protected EventDescriptor(string name, Attribute[] attrs) : base(name, attrs)
  43.         {
  44.         }
  45.         /// <devdoc>
  46.         /// <para>
  47.         /// Initializes a new instance of the <see cref='System.ComponentModel.EventDescriptor'/> class with the name and attributes in
  48.         /// the specified <see cref='System.ComponentModel.MemberDescriptor'/>
  49.         /// .
  50.         /// </para>
  51.         /// </devdoc>
  52.         protected EventDescriptor(MemberDescriptor descr) : base(descr)
  53.         {
  54.         }
  55.         /// <devdoc>
  56.         /// <para>
  57.         /// Initializes a new instance of the <see cref='System.ComponentModel.EventDescriptor'/> class with
  58.         /// the name in the specified <see cref='System.ComponentModel.MemberDescriptor'/> and the
  59.         /// attributes in both the <see cref='System.ComponentModel.MemberDescriptor'/> and the <see cref='System.Attribute'/>
  60.         /// array.
  61.         /// </para>
  62.         /// </devdoc>
  63.         protected EventDescriptor(MemberDescriptor descr, Attribute[] attrs) : base(descr, attrs)
  64.         {
  65.         }
  66.        
  67.         /// <devdoc>
  68.         /// <para>
  69.         /// When overridden in a derived
  70.         /// class,
  71.         /// gets the type of the component this event is bound to.
  72.         /// </para>
  73.         /// </devdoc>
  74.         public abstract Type ComponentType {
  75.             get;
  76.         }
  77.        
  78.         /// <devdoc>
  79.         /// <para>
  80.         /// When overridden in a derived
  81.         /// class, gets the type of delegate for the event.
  82.         /// </para>
  83.         /// </devdoc>
  84.         public abstract Type EventType {
  85.             get;
  86.         }
  87.        
  88.         /// <devdoc>
  89.         /// <para>
  90.         /// When overridden in a derived class, gets a value
  91.         /// indicating whether the event delegate is a multicast
  92.         /// delegate.
  93.         /// </para>
  94.         /// </devdoc>
  95.         public abstract bool IsMulticast {
  96.             get;
  97.         }
  98.        
  99.         /// <devdoc>
  100.         /// <para>
  101.         /// When overridden in
  102.         /// a derived class,
  103.         /// binds the event to the component.
  104.         /// </para>
  105.         /// </devdoc>
  106.         public abstract void AddEventHandler(object component, Delegate value);
  107.        
  108.         /// <devdoc>
  109.         /// <para>
  110.         /// When
  111.         /// overridden
  112.         /// in a derived class, unbinds the delegate from the
  113.         /// component
  114.         /// so that the delegate will no
  115.         /// longer receive events from the component.
  116.         /// </para>
  117.         /// </devdoc>
  118.         public abstract void RemoveEventHandler(object component, Delegate value);
  119.     }
  120. }

Developer Fusion