DebuggerBrowsableAttribute.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Diagnostics
  5. {
  6. // DebuggerBrowsableState states are defined as follows:
  7. // Never never show this element
  8. // Expanded expansion of the class is done, so that all visible internal members are shown
  9. // Collapsed expansion of the class is not performed. Internal visible members are hidden
  10. // RootHidden The target element itself should not be shown, but should instead be
  11. // automatically expanded to have its members displayed.
  12. // Default value is collapsed
  13. // Please also change the code which validates DebuggerBrowsableState variable (in this file)
  14. // if you change this enum.
  15. public enum DebuggerBrowsableState
  16. {
  17. Never = 0,
  18. //Expanded is not supported in this release
  19. //Expanded = 1,
  20. Collapsed = 2,
  21. RootHidden = 3
  22. }
  23. // the one currently supported with the csee.dat
  24. // (mcee.dat, autoexp.dat) file.
  25. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
  26. public sealed class DebuggerBrowsableAttribute : Attribute
  27. {
  28. public DebuggerBrowsableAttribute(DebuggerBrowsableState state)
  29. {
  30. if (state < DebuggerBrowsableState.Never || state > DebuggerBrowsableState.RootHidden)
  31. throw new ArgumentOutOfRangeException(nameof(state));
  32. State = state;
  33. }
  34. public DebuggerBrowsableState State { get; }
  35. }
  36. }