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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="TypeDescriptionProviderAttribute.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.    
  18.     using System;
  19.     using System.Security.Permissions;
  20.    
  21.     /// <devdoc>
  22.     /// </devdoc>
  23.     [AttributeUsage(AttributeTargets.Class, Inherited = true)]
  24.     public sealed class TypeDescriptionProviderAttribute : Attribute
  25.     {
  26.         private string _typeName;
  27.        
  28.         /// <devdoc>
  29.         /// Creates a new TypeDescriptionProviderAttribute object.
  30.         /// </devdoc>
  31.         public TypeDescriptionProviderAttribute(string typeName)
  32.         {
  33.             if (typeName == null) {
  34.                 throw new ArgumentNullException("typeName");
  35.             }
  36.            
  37.             _typeName = typeName;
  38.         }
  39.        
  40.         /// <devdoc>
  41.         /// Creates a new TypeDescriptionProviderAttribute object.
  42.         /// </devdoc>
  43.         public TypeDescriptionProviderAttribute(Type type)
  44.         {
  45.             if (type == null) {
  46.                 throw new ArgumentNullException("type");
  47.             }
  48.            
  49.             _typeName = type.AssemblyQualifiedName;
  50.         }
  51.        
  52.         /// <devdoc>
  53.         /// The TypeName property returns the assembly qualified type name
  54.         /// for the type description provider.
  55.         /// </devdoc>
  56.         public string TypeName {
  57.             get { return _typeName; }
  58.         }
  59.     }
  60. }

Developer Fusion