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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ComponentConverter.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.     using Microsoft.Win32;
  20.     using System.Collections;
  21.     using System.ComponentModel;
  22.     using System.ComponentModel.Design;
  23.     using System.Diagnostics;
  24.     using System.Runtime.Serialization.Formatters;
  25.     using System.Runtime.Remoting;
  26.     using System.Runtime.InteropServices;
  27.     using System.Security.Permissions;
  28.    
  29.     /// <devdoc>
  30.     /// <para>Provides a type converter to convert component objects to and
  31.     /// from various other representations.</para>
  32.     /// </devdoc>
  33.     [HostProtection(SharedState = true)]
  34.     public class ComponentConverter : ReferenceConverter
  35.     {
  36.        
  37.         /// <devdoc>
  38.         /// <para>
  39.         /// Initializes a new instance of the <see cref='System.ComponentModel.ComponentConverter'/> class.
  40.         /// </para>
  41.         /// </devdoc>
  42.         public ComponentConverter(Type type) : base(type)
  43.         {
  44.         }
  45.        
  46.         /// <internalonly/>
  47.         /// <devdoc>
  48.         /// <para>Gets a collection of properties for the type of component
  49.         /// specified by the value
  50.         /// parameter.</para>
  51.         /// </devdoc>
  52.         public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
  53.         {
  54.             return TypeDescriptor.GetProperties(value, attributes);
  55.         }
  56.        
  57.         /// <internalonly/>
  58.         /// <devdoc>
  59.         /// <para>Gets a value indicating whether this object supports properties using the
  60.         /// specified context.</para>
  61.         /// </devdoc>
  62.         public override bool GetPropertiesSupported(ITypeDescriptorContext context)
  63.         {
  64.             return true;
  65.         }
  66.     }
  67. }

Developer Fusion