EnumDescriptorIndexAttribute.cs 530 B

1234567891011121314151617181920
  1. using System;
  2. namespace Google.ProtocolBuffers.Descriptors {
  3. /// <summary>
  4. /// Allows enum values to express the index within their descriptor.
  5. /// TODO(jonskeet): Consider removing this. I don't think we need it after all.
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Field)]
  8. public class EnumDescriptorIndexAttribute : Attribute {
  9. readonly int index;
  10. internal int Index {
  11. get { return index; }
  12. }
  13. internal EnumDescriptorIndexAttribute(int index) {
  14. this.index = index;
  15. }
  16. }
  17. }