diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestRetention.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestRetention.pb.cs
new file mode 100644
index 000000000000..8c8d37351ae0
--- /dev/null
+++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestRetention.pb.cs
@@ -0,0 +1,1141 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/protobuf/unittest_retention.proto
+//
+#pragma warning disable 1591, 0612, 3021, 8981
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace ProtobufUnittest {
+
+ /// Holder for reflection information generated from google/protobuf/unittest_retention.proto
+ public static partial class UnittestRetentionReflection {
+
+ #region Descriptor
+ /// File descriptor for google/protobuf/unittest_retention.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static UnittestRetentionReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "Cihnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcmV0ZW50aW9uLnByb3RvEhFw",
+ "cm90b2J1Zl91bml0dGVzdBogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3Iu",
+ "cHJvdG8icAoOT3B0aW9uc01lc3NhZ2USEwoLcGxhaW5fZmllbGQYASABKAUS",
+ "JAoXcnVudGltZV9yZXRlbnRpb25fZmllbGQYAiABKAVCA4gBARIjChZzb3Vy",
+ "Y2VfcmV0ZW50aW9uX2ZpZWxkGAMgASgFQgOIAQIiFgoIRXh0ZW5kZWUqBAgB",
+ "EAIqBAgCEAMi8QEKD1RvcExldmVsTWVzc2FnZRIXCgFmGAEgASgCQgyauu2E",
+ "DwYIARACGAMSCwoBaRgCIAEoA0gAGh0KDU5lc3RlZE1lc3NhZ2U6DJrF3oUP",
+ "BggBEAIYAyIuCgpOZXN0ZWRFbnVtEhIKDk5FU1RFRF9VTktOT1dOEAAaDPqe",
+ "qoQPBggBEAIYAyoSCAoQZRoMopjfhQ8GCAEQAhgDMjQKAXMSGy5wcm90b2J1",
+ "Zl91bml0dGVzdC5FeHRlbmRlZRgCIAEoCUIMmrrthA8GCAEQAhgDOgyaxd6F",
+ "DwYIARACGANCEQoBbxIMitu3hA8GCAEQAhgDKkEKDFRvcExldmVsRW51bRIj",
+ "ChFUT1BfTEVWRUxfVU5LTk9XThAAGgzS3amEDwYIARACGAMaDPqeqoQPBggB",
+ "EAIYAzJ4CgdTZXJ2aWNlEl8KB0RvU3R1ZmYSIi5wcm90b2J1Zl91bml0dGVz",
+ "dC5Ub3BMZXZlbE1lc3NhZ2UaIi5wcm90b2J1Zl91bml0dGVzdC5Ub3BMZXZl",
+ "bE1lc3NhZ2UiDOKu+IMPBggBEAIYAxoM6oeLhA8GCAEQAhgDOjYKDHBsYWlu",
+ "X29wdGlvbhIcLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxjGtezwASAB",
+ "KAU6RwoYcnVudGltZV9yZXRlbnRpb25fb3B0aW9uEhwuZ29vZ2xlLnByb3Rv",
+ "YnVmLkZpbGVPcHRpb25zGJyS6fABIAEoBUIDiAEBOkYKF3NvdXJjZV9yZXRl",
+ "bnRpb25fb3B0aW9uEhwuZ29vZ2xlLnByb3RvYnVmLkZpbGVPcHRpb25zGNSs",
+ "3/ABIAEoBUIDiAECOlgKC2ZpbGVfb3B0aW9uEhwuZ29vZ2xlLnByb3RvYnVm",
+ "LkZpbGVPcHRpb25zGIDy3vABIAEoCzIhLnByb3RvYnVmX3VuaXR0ZXN0Lk9w",
+ "dGlvbnNNZXNzYWdlOl0KEHJlcGVhdGVkX29wdGlvbnMSHC5nb29nbGUucHJv",
+ "dG9idWYuRmlsZU9wdGlvbnMYkv7b8AEgAygLMiEucHJvdG9idWZfdW5pdHRl",
+ "c3QuT3B0aW9uc01lc3NhZ2U6bQoWZXh0ZW5zaW9uX3JhbmdlX29wdGlvbhIm",
+ "Lmdvb2dsZS5wcm90b2J1Zi5FeHRlbnNpb25SYW5nZU9wdGlvbnMYhPPb8AEg",
+ "ASgLMiEucHJvdG9idWZfdW5pdHRlc3QuT3B0aW9uc01lc3NhZ2U6XgoObWVz",
+ "c2FnZV9vcHRpb24SHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY",
+ "0+jb8AEgASgLMiEucHJvdG9idWZfdW5pdHRlc3QuT3B0aW9uc01lc3NhZ2U6",
+ "WgoMZmllbGRfb3B0aW9uEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9u",
+ "cxij183wASABKAsyIS5wcm90b2J1Zl91bml0dGVzdC5PcHRpb25zTWVzc2Fn",
+ "ZTpaCgxvbmVvZl9vcHRpb24SHS5nb29nbGUucHJvdG9idWYuT25lb2ZPcHRp",
+ "b25zGLH7xvABIAEoCzIhLnByb3RvYnVmX3VuaXR0ZXN0Lk9wdGlvbnNNZXNz",
+ "YWdlOlgKC2VudW1fb3B0aW9uEhwuZ29vZ2xlLnByb3RvYnVmLkVudW1PcHRp",
+ "b25zGO+jxfABIAEoCzIhLnByb3RvYnVmX3VuaXR0ZXN0Lk9wdGlvbnNNZXNz",
+ "YWdlOmMKEWVudW1fZW50cnlfb3B0aW9uEiEuZ29vZ2xlLnByb3RvYnVmLkVu",
+ "dW1WYWx1ZU9wdGlvbnMY2pvF8AEgASgLMiEucHJvdG9idWZfdW5pdHRlc3Qu",
+ "T3B0aW9uc01lc3NhZ2U6XgoOc2VydmljZV9vcHRpb24SHy5nb29nbGUucHJv",
+ "dG9idWYuU2VydmljZU9wdGlvbnMY/bDB8AEgASgLMiEucHJvdG9idWZfdW5p",
+ "dHRlc3QuT3B0aW9uc01lc3NhZ2U6XAoNbWV0aG9kX29wdGlvbhIeLmdvb2ds",
+ "ZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGOyFv/ABIAEoCzIhLnByb3RvYnVm",
+ "X3VuaXR0ZXN0Lk9wdGlvbnNNZXNzYWdlOjQKAWkSGy5wcm90b2J1Zl91bml0",
+ "dGVzdC5FeHRlbmRlZRgBIAEoBUIMmrrthA8GCAEQAhgDQiqwrOOGDwHgkcmG",
+ "DwKg5fqFDwOCkPeFDwYIARACGAOS8d+FDwYIARACGAM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, },
+ new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ProtobufUnittest.TopLevelEnum), }, new pb::Extension[] { UnittestRetentionExtensions.PlainOption, UnittestRetentionExtensions.RuntimeRetentionOption, UnittestRetentionExtensions.SourceRetentionOption, UnittestRetentionExtensions.FileOption, UnittestRetentionExtensions.RepeatedOptions, UnittestRetentionExtensions.ExtensionRangeOption, UnittestRetentionExtensions.MessageOption, UnittestRetentionExtensions.FieldOption, UnittestRetentionExtensions.OneofOption, UnittestRetentionExtensions.EnumOption, UnittestRetentionExtensions.EnumEntryOption, UnittestRetentionExtensions.ServiceOption, UnittestRetentionExtensions.MethodOption, UnittestRetentionExtensions.I }, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.OptionsMessage), global::ProtobufUnittest.OptionsMessage.Parser, new[]{ "PlainField", "RuntimeRetentionField", "SourceRetentionField" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.Extendee), global::ProtobufUnittest.Extendee.Parser, null, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TopLevelMessage), global::ProtobufUnittest.TopLevelMessage.Parser, new[]{ "F", "I" }, new[]{ "O" }, new[]{ typeof(global::ProtobufUnittest.TopLevelMessage.Types.NestedEnum) }, new pb::Extension[] { global::ProtobufUnittest.TopLevelMessage.Extensions.S }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TopLevelMessage.Types.NestedMessage), global::ProtobufUnittest.TopLevelMessage.Types.NestedMessage.Parser, null, null, null, null, null)})
+ }));
+ }
+ #endregion
+
+ }
+ /// Holder for extension identifiers generated from the top level of google/protobuf/unittest_retention.proto
+ public static partial class UnittestRetentionExtensions {
+ public static readonly pb::Extension PlainOption =
+ new pb::Extension(505092806, pb::FieldCodec.ForInt32(4040742448, 0));
+ public static readonly pb::Extension RuntimeRetentionOption =
+ new pb::Extension(505039132, pb::FieldCodec.ForInt32(4040313056, 0));
+ public static readonly pb::Extension SourceRetentionOption =
+ new pb::Extension(504878676, pb::FieldCodec.ForInt32(4039029408, 0));
+ public static readonly pb::Extension FileOption =
+ new pb::Extension(504871168, pb::FieldCodec.ForMessage(4038969346, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::RepeatedExtension RepeatedOptions =
+ new pb::RepeatedExtension(504823570, pb::FieldCodec.ForMessage(4038588562, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension ExtensionRangeOption =
+ new pb::Extension(504822148, pb::FieldCodec.ForMessage(4038577186, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension MessageOption =
+ new pb::Extension(504820819, pb::FieldCodec.ForMessage(4038566554, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension FieldOption =
+ new pb::Extension(504589219, pb::FieldCodec.ForMessage(4036713754, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension OneofOption =
+ new pb::Extension(504479153, pb::FieldCodec.ForMessage(4035833226, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension EnumOption =
+ new pb::Extension(504451567, pb::FieldCodec.ForMessage(4035612538, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension EnumEntryOption =
+ new pb::Extension(504450522, pb::FieldCodec.ForMessage(4035604178, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension ServiceOption =
+ new pb::Extension(504387709, pb::FieldCodec.ForMessage(4035101674, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension MethodOption =
+ new pb::Extension(504349420, pb::FieldCodec.ForMessage(4034795362, global::ProtobufUnittest.OptionsMessage.Parser));
+ public static readonly pb::Extension I =
+ new pb::Extension(1, pb::FieldCodec.ForInt32(8, 0));
+ }
+
+ #region Enums
+ public enum TopLevelEnum {
+ [pbr::OriginalName("TOP_LEVEL_UNKNOWN")] TopLevelUnknown = 0,
+ }
+
+ #endregion
+
+ #region Messages
+ ///
+ /// Retention attributes set on fields nested within a message
+ ///
+ public sealed partial class OptionsMessage : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionsMessage());
+ private pb::UnknownFieldSet _unknownFields;
+ private int _hasBits0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::ProtobufUnittest.UnittestRetentionReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public OptionsMessage() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public OptionsMessage(OptionsMessage other) : this() {
+ _hasBits0 = other._hasBits0;
+ plainField_ = other.plainField_;
+ runtimeRetentionField_ = other.runtimeRetentionField_;
+ sourceRetentionField_ = other.sourceRetentionField_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public OptionsMessage Clone() {
+ return new OptionsMessage(this);
+ }
+
+ /// Field number for the "plain_field" field.
+ public const int PlainFieldFieldNumber = 1;
+ private readonly static int PlainFieldDefaultValue = 0;
+
+ private int plainField_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int PlainField {
+ get { if ((_hasBits0 & 1) != 0) { return plainField_; } else { return PlainFieldDefaultValue; } }
+ set {
+ _hasBits0 |= 1;
+ plainField_ = value;
+ }
+ }
+ /// Gets whether the "plain_field" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasPlainField {
+ get { return (_hasBits0 & 1) != 0; }
+ }
+ /// Clears the value of the "plain_field" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearPlainField() {
+ _hasBits0 &= ~1;
+ }
+
+ /// Field number for the "runtime_retention_field" field.
+ public const int RuntimeRetentionFieldFieldNumber = 2;
+ private readonly static int RuntimeRetentionFieldDefaultValue = 0;
+
+ private int runtimeRetentionField_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int RuntimeRetentionField {
+ get { if ((_hasBits0 & 2) != 0) { return runtimeRetentionField_; } else { return RuntimeRetentionFieldDefaultValue; } }
+ set {
+ _hasBits0 |= 2;
+ runtimeRetentionField_ = value;
+ }
+ }
+ /// Gets whether the "runtime_retention_field" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasRuntimeRetentionField {
+ get { return (_hasBits0 & 2) != 0; }
+ }
+ /// Clears the value of the "runtime_retention_field" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearRuntimeRetentionField() {
+ _hasBits0 &= ~2;
+ }
+
+ /// Field number for the "source_retention_field" field.
+ public const int SourceRetentionFieldFieldNumber = 3;
+ private readonly static int SourceRetentionFieldDefaultValue = 0;
+
+ private int sourceRetentionField_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int SourceRetentionField {
+ get { if ((_hasBits0 & 4) != 0) { return sourceRetentionField_; } else { return SourceRetentionFieldDefaultValue; } }
+ set {
+ _hasBits0 |= 4;
+ sourceRetentionField_ = value;
+ }
+ }
+ /// Gets whether the "source_retention_field" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasSourceRetentionField {
+ get { return (_hasBits0 & 4) != 0; }
+ }
+ /// Clears the value of the "source_retention_field" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearSourceRetentionField() {
+ _hasBits0 &= ~4;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as OptionsMessage);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(OptionsMessage other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (PlainField != other.PlainField) return false;
+ if (RuntimeRetentionField != other.RuntimeRetentionField) return false;
+ if (SourceRetentionField != other.SourceRetentionField) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (HasPlainField) hash ^= PlainField.GetHashCode();
+ if (HasRuntimeRetentionField) hash ^= RuntimeRetentionField.GetHashCode();
+ if (HasSourceRetentionField) hash ^= SourceRetentionField.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (HasPlainField) {
+ output.WriteRawTag(8);
+ output.WriteInt32(PlainField);
+ }
+ if (HasRuntimeRetentionField) {
+ output.WriteRawTag(16);
+ output.WriteInt32(RuntimeRetentionField);
+ }
+ if (HasSourceRetentionField) {
+ output.WriteRawTag(24);
+ output.WriteInt32(SourceRetentionField);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (HasPlainField) {
+ output.WriteRawTag(8);
+ output.WriteInt32(PlainField);
+ }
+ if (HasRuntimeRetentionField) {
+ output.WriteRawTag(16);
+ output.WriteInt32(RuntimeRetentionField);
+ }
+ if (HasSourceRetentionField) {
+ output.WriteRawTag(24);
+ output.WriteInt32(SourceRetentionField);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (HasPlainField) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainField);
+ }
+ if (HasRuntimeRetentionField) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(RuntimeRetentionField);
+ }
+ if (HasSourceRetentionField) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(SourceRetentionField);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(OptionsMessage other) {
+ if (other == null) {
+ return;
+ }
+ if (other.HasPlainField) {
+ PlainField = other.PlainField;
+ }
+ if (other.HasRuntimeRetentionField) {
+ RuntimeRetentionField = other.RuntimeRetentionField;
+ }
+ if (other.HasSourceRetentionField) {
+ SourceRetentionField = other.SourceRetentionField;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ PlainField = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ RuntimeRetentionField = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ SourceRetentionField = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ PlainField = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ RuntimeRetentionField = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ SourceRetentionField = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ public sealed partial class Extendee : pb::IExtendableMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Extendee());
+ private pb::UnknownFieldSet _unknownFields;
+ private pb::ExtensionSet _extensions;
+ private pb::ExtensionSet _Extensions { get { return _extensions; } }
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::ProtobufUnittest.UnittestRetentionReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Extendee() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Extendee(Extendee other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ _extensions = pb::ExtensionSet.Clone(other._extensions);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Extendee Clone() {
+ return new Extendee(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as Extendee);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(Extendee other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!Equals(_extensions, other._extensions)) {
+ return false;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_extensions != null) {
+ hash ^= _extensions.GetHashCode();
+ }
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (_extensions != null) {
+ _extensions.WriteTo(output);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (_extensions != null) {
+ _extensions.WriteTo(ref output);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (_extensions != null) {
+ size += _extensions.CalculateSize();
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(Extendee other) {
+ if (other == null) {
+ return;
+ }
+ pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ }
+ break;
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ }
+ break;
+ }
+ }
+ }
+ #endif
+
+ public TValue GetExtension(pb::Extension extension) {
+ return pb::ExtensionSet.Get(ref _extensions, extension);
+ }
+ public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) {
+ return pb::ExtensionSet.Get(ref _extensions, extension);
+ }
+ public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) {
+ return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension);
+ }
+ public void SetExtension(pb::Extension extension, TValue value) {
+ pb::ExtensionSet.Set(ref _extensions, extension, value);
+ }
+ public bool HasExtension(pb::Extension extension) {
+ return pb::ExtensionSet.Has(ref _extensions, extension);
+ }
+ public void ClearExtension(pb::Extension extension) {
+ pb::ExtensionSet.Clear(ref _extensions, extension);
+ }
+ public void ClearExtension(pb::RepeatedExtension extension) {
+ pb::ExtensionSet.Clear(ref _extensions, extension);
+ }
+
+ }
+
+ public sealed partial class TopLevelMessage : pb::IExtendableMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopLevelMessage());
+ private pb::UnknownFieldSet _unknownFields;
+ private pb::ExtensionSet _extensions;
+ private pb::ExtensionSet _Extensions { get { return _extensions; } }
+ private int _hasBits0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::ProtobufUnittest.UnittestRetentionReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TopLevelMessage() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TopLevelMessage(TopLevelMessage other) : this() {
+ _hasBits0 = other._hasBits0;
+ f_ = other.f_;
+ switch (other.OCase) {
+ case OOneofCase.I:
+ I = other.I;
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ _extensions = pb::ExtensionSet.Clone(other._extensions);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TopLevelMessage Clone() {
+ return new TopLevelMessage(this);
+ }
+
+ /// Field number for the "f" field.
+ public const int FFieldNumber = 1;
+ private readonly static float FDefaultValue = 0F;
+
+ private float f_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public float F {
+ get { if ((_hasBits0 & 1) != 0) { return f_; } else { return FDefaultValue; } }
+ set {
+ _hasBits0 |= 1;
+ f_ = value;
+ }
+ }
+ /// Gets whether the "f" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasF {
+ get { return (_hasBits0 & 1) != 0; }
+ }
+ /// Clears the value of the "f" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearF() {
+ _hasBits0 &= ~1;
+ }
+
+ /// Field number for the "i" field.
+ public const int IFieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long I {
+ get { return HasI ? (long) o_ : 0L; }
+ set {
+ o_ = value;
+ oCase_ = OOneofCase.I;
+ }
+ }
+ /// Gets whether the "i" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasI {
+ get { return oCase_ == OOneofCase.I; }
+ }
+ /// Clears the value of the oneof if it's currently set to "i"
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearI() {
+ if (HasI) {
+ ClearO();
+ }
+ }
+
+ private object o_;
+ /// Enum of possible cases for the "o" oneof.
+ public enum OOneofCase {
+ None = 0,
+ I = 2,
+ }
+ private OOneofCase oCase_ = OOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public OOneofCase OCase {
+ get { return oCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearO() {
+ oCase_ = OOneofCase.None;
+ o_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as TopLevelMessage);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(TopLevelMessage other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(F, other.F)) return false;
+ if (I != other.I) return false;
+ if (OCase != other.OCase) return false;
+ if (!Equals(_extensions, other._extensions)) {
+ return false;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (HasF) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(F);
+ if (HasI) hash ^= I.GetHashCode();
+ hash ^= (int) oCase_;
+ if (_extensions != null) {
+ hash ^= _extensions.GetHashCode();
+ }
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (HasF) {
+ output.WriteRawTag(13);
+ output.WriteFloat(F);
+ }
+ if (HasI) {
+ output.WriteRawTag(16);
+ output.WriteInt64(I);
+ }
+ if (_extensions != null) {
+ _extensions.WriteTo(output);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (HasF) {
+ output.WriteRawTag(13);
+ output.WriteFloat(F);
+ }
+ if (HasI) {
+ output.WriteRawTag(16);
+ output.WriteInt64(I);
+ }
+ if (_extensions != null) {
+ _extensions.WriteTo(ref output);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (HasF) {
+ size += 1 + 4;
+ }
+ if (HasI) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(I);
+ }
+ if (_extensions != null) {
+ size += _extensions.CalculateSize();
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(TopLevelMessage other) {
+ if (other == null) {
+ return;
+ }
+ if (other.HasF) {
+ F = other.F;
+ }
+ switch (other.OCase) {
+ case OOneofCase.I:
+ I = other.I;
+ break;
+ }
+
+ pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ }
+ break;
+ case 13: {
+ F = input.ReadFloat();
+ break;
+ }
+ case 16: {
+ I = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ }
+ break;
+ case 13: {
+ F = input.ReadFloat();
+ break;
+ }
+ case 16: {
+ I = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ public TValue GetExtension(pb::Extension extension) {
+ return pb::ExtensionSet.Get(ref _extensions, extension);
+ }
+ public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) {
+ return pb::ExtensionSet.Get(ref _extensions, extension);
+ }
+ public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) {
+ return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension);
+ }
+ public void SetExtension(pb::Extension extension, TValue value) {
+ pb::ExtensionSet.Set(ref _extensions, extension, value);
+ }
+ public bool HasExtension(pb::Extension extension) {
+ return pb::ExtensionSet.Has(ref _extensions, extension);
+ }
+ public void ClearExtension(pb::Extension extension) {
+ pb::ExtensionSet.Clear(ref _extensions, extension);
+ }
+ public void ClearExtension(pb::RepeatedExtension extension) {
+ pb::ExtensionSet.Clear(ref _extensions, extension);
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the TopLevelMessage message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static partial class Types {
+ public enum NestedEnum {
+ [pbr::OriginalName("NESTED_UNKNOWN")] NestedUnknown = 0,
+ }
+
+ public sealed partial class NestedMessage : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::ProtobufUnittest.TopLevelMessage.Descriptor.NestedTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public NestedMessage() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public NestedMessage(NestedMessage other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public NestedMessage Clone() {
+ return new NestedMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as NestedMessage);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(NestedMessage other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(NestedMessage other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ }
+ }
+ }
+ #endif
+
+ }
+
+ }
+ #endregion
+
+ #region Extensions
+ /// Container for extensions for other messages declared in the TopLevelMessage message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static partial class Extensions {
+ public static readonly pb::Extension S =
+ new pb::Extension(2, pb::FieldCodec.ForString(18, ""));
+ }
+ #endregion
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/csharp/src/Google.Protobuf.Test/testprotos.pb b/csharp/src/Google.Protobuf.Test/testprotos.pb
index c88bd0a881d7..782f0b0da127 100644
Binary files a/csharp/src/Google.Protobuf.Test/testprotos.pb and b/csharp/src/Google.Protobuf.Test/testprotos.pb differ