Added FieldDescriptor.IsExtension and sealed ExtensionCollection

pull/5936/head
Sydney Acksman 6 years ago
parent 8b7fb7d0f4
commit 8e917d1688
  1. 2
      csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs
  2. 5
      csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

@ -39,7 +39,7 @@ namespace Google.Protobuf.Reflection
/// <summary>
/// A collection to simplify retrieving the descriptors of extensions in a descriptor for a message
/// </summary>
public class ExtensionCollection
public sealed class ExtensionCollection
{
private IDictionary<MessageDescriptor, IList<FieldDescriptor>> extensionsByTypeInDeclarationOrder;
private IDictionary<MessageDescriptor, IList<FieldDescriptor>> extensionsByTypeInNumberOrder;

@ -203,6 +203,11 @@ namespace Google.Protobuf.Reflection
/// </summary>
public bool IsPacked => File.Proto.Syntax == "proto2" ? Proto.Options?.Packed ?? false : !Proto.Options.HasPacked || Proto.Options.Packed;
/// <summary>
/// Returns <c>true</c> if this field extends another message type; <c>false</c> otherwise.
/// </summary>
public bool IsExtension => Proto.HasExtendee;
/// <summary>
/// Returns the type of the field.
/// </summary>

Loading…
Cancel
Save