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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="EditorBrowsableAttribute.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.     using System.Security.Permissions;
  18.    
  19.     /// <devdoc>
  20.     /// <para>[To be supplied.]</para>
  21.     /// </devdoc>
  22.     [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate | AttributeTargets.Interface)]
  23.     public sealed class EditorBrowsableAttribute : Attribute
  24.     {
  25.         private EditorBrowsableState browsableState;
  26.        
  27.        
  28.         /// <devdoc>
  29.         /// <para>[To be supplied.]</para>
  30.         /// </devdoc>
  31.         public EditorBrowsableAttribute(EditorBrowsableState state)
  32.         {
  33.             browsableState = state;
  34.         }
  35.        
  36.         /// <devdoc>
  37.         /// <para>[To be supplied.]</para>
  38.         /// </devdoc>
  39.         public EditorBrowsableAttribute() : this(EditorBrowsableState.Always)
  40.         {
  41.         }
  42.        
  43.         /// <devdoc>
  44.         /// <para>[To be supplied.]</para>
  45.         /// </devdoc>
  46.         public EditorBrowsableState State {
  47.             get { return browsableState; }
  48.         }
  49.        
  50.         public override bool Equals(object obj)
  51.         {
  52.             if (obj == this) {
  53.                 return true;
  54.             }
  55.            
  56.             EditorBrowsableAttribute other = obj as EditorBrowsableAttribute;
  57.            
  58.             return (other != null) && other.browsableState == browsableState;
  59.         }
  60.        
  61.         public override int GetHashCode()
  62.         {
  63.             return base.GetHashCode();
  64.         }
  65.     }
  66.    
  67.     /// <devdoc>
  68.     /// <para>[To be supplied.]</para>
  69.     /// </devdoc>
  70.     public enum EditorBrowsableState
  71.     {
  72.         /// <devdoc>
  73.         /// <para>[To be supplied.]</para>
  74.         /// </devdoc>
  75.         Always,
  76.         /// <devdoc>
  77.         /// <para>[To be supplied.]</para>
  78.         /// </devdoc>
  79.         Never,
  80.         /// <devdoc>
  81.         /// <para>[To be supplied.]</para>
  82.         /// </devdoc>
  83.         Advanced
  84.     }
  85. }

Developer Fusion