summaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2015-07-10 09:08:44 +0100
committerJon Skeet <skeet@pobox.com>2015-07-10 09:08:44 +0100
commit94878b308041626794e6e39a687f174f2bf04b07 (patch)
tree439cc2d2ff26a66212f7270e7301b854c64bb238 /csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs
parentdb552c929719edc70bfb76a039ae83153472e50d (diff)
parent0da4a89c971b51f814f9dbe76a1dca47f5b440b4 (diff)
downloadprotobuf-javalite-94878b308041626794e6e39a687f174f2bf04b07.tar.gz
Merge pull request #566 from jskeet/csharp-reflection
Improve C# reflection support
Diffstat (limited to 'csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs')
-rw-r--r--csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs
index 9f10990b..a6db5268 100644
--- a/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs
+++ b/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs
@@ -38,14 +38,16 @@ namespace Google.Protobuf.Descriptors
/// <summary>
/// Descriptor for an enum type in a .proto file.
/// </summary>
- public sealed class EnumDescriptor : IndexedDescriptorBase<EnumDescriptorProto, EnumOptions>
+ public sealed class EnumDescriptor : DescriptorBase
{
+ private readonly EnumDescriptorProto proto;
private readonly MessageDescriptor containingType;
private readonly IList<EnumValueDescriptor> values;
internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index)
- : base(proto, file, ComputeFullName(file, parent, proto.Name), index)
+ : base(file, file.ComputeFullName(parent, proto.Name), index)
{
+ this.proto = proto;
containingType = parent;
if (proto.Value.Count == 0)
@@ -61,6 +63,13 @@ namespace Google.Protobuf.Descriptors
File.DescriptorPool.AddSymbol(this);
}
+ internal EnumDescriptorProto Proto { get { return proto; } }
+
+ /// <summary>
+ /// The brief name of the descriptor's target.
+ /// </summary>
+ public override string Name { get { return proto.Name; } }
+
/// <value>
/// If this is a nested type, get the outer descriptor, otherwise null.
/// </value>
@@ -95,14 +104,5 @@ namespace Google.Protobuf.Descriptors
{
return File.DescriptorPool.FindSymbol<EnumValueDescriptor>(FullName + "." + name);
}
-
- internal override void ReplaceProto(EnumDescriptorProto newProto)
- {
- base.ReplaceProto(newProto);
- for (int i = 0; i < values.Count; i++)
- {
- values[i].ReplaceProto(newProto.Value[i]);
- }
- }
}
} \ No newline at end of file