aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-22 10:36:06 -0700
committerJan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-22 10:36:06 -0700
commit7b5c3967991b6534f439cb31b0d247501f4a0ef8 (patch)
treee161b4bfaa308ca173ee9a8b2ff858c5b76b618b /csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs
parent2ee4b5665520fe3245eb5e15df8bd35e0c539a07 (diff)
parent43d64b4f54c8cf9521aded37fc695faba28793ee (diff)
downloadprotobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.tar.gz
protobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.tar.bz2
protobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.zip
Merge pull request #625 from jskeet/reflection-refactor
Reflection refactor
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs')
-rw-r--r--csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs
index bf8f8c83..285f26f3 100644
--- a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs
@@ -30,6 +30,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
+using System;
using System.Collections.Generic;
namespace Google.Protobuf.Reflection
@@ -42,11 +43,13 @@ namespace Google.Protobuf.Reflection
private readonly EnumDescriptorProto proto;
private readonly MessageDescriptor containingType;
private readonly IList<EnumValueDescriptor> values;
+ private readonly Type generatedType;
- internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index)
+ internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index, Type generatedType)
: base(file, file.ComputeFullName(parent, proto.Name), index)
{
this.proto = proto;
+ this.generatedType = generatedType;
containingType = parent;
if (proto.Value.Count == 0)
@@ -69,6 +72,11 @@ namespace Google.Protobuf.Reflection
/// </summary>
public override string Name { get { return proto.Name; } }
+ /// <summary>
+ /// The generated type for this enum, or <c>null</c> if the descriptor does not represent a generated type.
+ /// </summary>
+ public Type GeneratedType { get { return generatedType; } }
+
/// <value>
/// If this is a nested type, get the outer descriptor, otherwise null.
/// </value>