EnumMemberAttribute.cs 780 B

12345678910111213141516171819202122232425262728
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.Runtime.Serialization
  5. {
  6. [AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
  7. public sealed class EnumMemberAttribute : Attribute
  8. {
  9. string value;
  10. bool isValueSetExplicitly;
  11. public EnumMemberAttribute()
  12. {
  13. }
  14. public string Value
  15. {
  16. get { return this.value; }
  17. set { this.value = value; this.isValueSetExplicitly = true; }
  18. }
  19. public bool IsValueSetExplicitly
  20. {
  21. get { return this.isValueSetExplicitly; }
  22. }
  23. }
  24. }