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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IServiceObjectContainer.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.Design
  18. {
  19.     using System;
  20.    
  21.     /// <devdoc>
  22.     /// This interface provides a container for services. A service container
  23.     /// is, by definition, a service provider. In addition to providing services
  24.     /// it also provides a mechanism for adding and removing services.
  25.     /// </devdoc>
  26.     [System.Runtime.InteropServices.ComVisible(true)]
  27.     public interface IServiceContainer : IServiceProvider
  28.     {
  29.        
  30.         /// <devdoc>
  31.         /// Adds the given service to the service container.
  32.         /// </devdoc>
  33.         void AddService(Type serviceType, object serviceInstance);
  34.        
  35.         /// <devdoc>
  36.         /// Adds the given service to the service container.
  37.         /// </devdoc>
  38.         void AddService(Type serviceType, object serviceInstance, bool promote);
  39.        
  40.         /// <devdoc>
  41.         /// Adds the given service to the service container.
  42.         /// </devdoc>
  43.         void AddService(Type serviceType, ServiceCreatorCallback callback);
  44.        
  45.         /// <devdoc>
  46.         /// Adds the given service to the service container.
  47.         /// </devdoc>
  48.         void AddService(Type serviceType, ServiceCreatorCallback callback, bool promote);
  49.        
  50.         /// <devdoc>
  51.         /// Removes the given service type from the service container.
  52.         /// </devdoc>
  53.         void RemoveService(Type serviceType);
  54.        
  55.         /// <devdoc>
  56.         /// Removes the given service type from the service container.
  57.         /// </devdoc>
  58.         void RemoveService(Type serviceType, bool promote);
  59.     }
  60. }

Developer Fusion