The Labs \ Source Viewer \ SSCLI \ System.ComponentModel.Design \ IEventBindingService

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IEventPropertyService.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.Design
  16. {
  17.     using System;
  18.     using System.Collections;
  19.     using System.ComponentModel;
  20.     using Microsoft.Win32;
  21.    
  22.     /// <devdoc>
  23.     /// <para>Provides a set of useful methods for binding <see cref='System.ComponentModel.EventDescriptor'/> objects to user code.</para>
  24.     /// </devdoc>
  25.     [System.Runtime.InteropServices.ComVisible(true)]
  26.     public interface IEventBindingService
  27.     {
  28.        
  29.         /// <devdoc>
  30.         /// This creates a name for an event handling method for the given component
  31.         /// and event. The name that is created is guaranteed to be unique in the user's source
  32.         /// code.
  33.         /// </devdoc>
  34.         string CreateUniqueMethodName(IComponent component, EventDescriptor e);
  35.        
  36.         /// <devdoc>
  37.         /// Retrieves a collection of strings. Each string is the name of a method
  38.         /// in user code that has a signature that is compatible with the given event.
  39.         /// </devdoc>
  40.         ICollection GetCompatibleMethods(EventDescriptor e);
  41.        
  42.         /// <devdoc>
  43.         /// For properties that are representing events, this will return the event
  44.         /// that the property represents.
  45.         /// </devdoc>
  46.         EventDescriptor GetEvent(PropertyDescriptor property);
  47.        
  48.         /// <devdoc>
  49.         /// <para>Converts a set of event descriptors to a set of property descriptors.</para>
  50.         /// </devdoc>
  51.         PropertyDescriptorCollection GetEventProperties(EventDescriptorCollection events);
  52.        
  53.         /// <devdoc>
  54.         /// <para>
  55.         /// Converts a single event to a property.
  56.         /// </para>
  57.         /// </devdoc>
  58.         PropertyDescriptor GetEventProperty(EventDescriptor e);
  59.        
  60.         /// <devdoc>
  61.         /// Displays the user code for the designer. This will return true if the user
  62.         /// code could be displayed, or false otherwise.
  63.         /// </devdoc>
  64.         bool ShowCode();
  65.        
  66.         /// <devdoc>
  67.         /// Displays the user code for the designer. This will return true if the user
  68.         /// code could be displayed, or false otherwise.
  69.         /// </devdoc>
  70.         bool ShowCode(int lineNumber);
  71.        
  72.         /// <devdoc>
  73.         /// Displays the user code for the given event. This will return true if the user
  74.         /// code could be displayed, or false otherwise.
  75.         /// </devdoc>
  76.         bool ShowCode(IComponent component, EventDescriptor e);
  77.     }
  78. }

Developer Fusion