diff options
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs | 10 |
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> |