| // Generated by the protocol buffer compiler. DO NOT EDIT! |
| // source: google/protobuf/unittest_preserve_unknown_enum.proto |
| #pragma warning disable 1591, 0612, 3021 |
| #region Designer generated code |
| |
| using pb = global::Google.ProtocolBuffers; |
| using pbc = global::Google.ProtocolBuffers.Collections; |
| using pbd = global::Google.ProtocolBuffers.Descriptors; |
| using scg = global::System.Collections.Generic; |
| namespace Google.ProtocolBuffers.TestProtos { |
| |
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| public static partial class UnittestPreserveUnknownEnum { |
| |
| #region Extension registration |
| public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
| } |
| #endregion |
| #region Static variables |
| internal static pbd::MessageDescriptor internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor; |
| internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MyMessage, global::Google.ProtocolBuffers.TestProtos.MyMessage.Builder> internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; |
| internal static pbd::MessageDescriptor internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor; |
| internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra, global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.Builder> internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__FieldAccessorTable; |
| #endregion |
| #region Descriptor |
| public static pbd::FileDescriptor Descriptor { |
| get { return descriptor; } |
| } |
| private static pbd::FileDescriptor descriptor; |
| |
| static UnittestPreserveUnknownEnum() { |
| byte[] descriptorData = global::System.Convert.FromBase64String( |
| string.Concat( |
| "CjRnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJlc2VydmVfdW5rbm93bl9l", |
| "bnVtLnByb3RvEiVwcm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0", |
| "ZXN0IsEDCglNeU1lc3NhZ2USOAoBZRgBIAEoDjItLnByb3RvM19wcmVzZXJ2", |
| "ZV91bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtEkEKCnJlcGVhdGVkX2UY", |
| "AiADKA4yLS5wcm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0", |
| "Lk15RW51bRJMChFyZXBlYXRlZF9wYWNrZWRfZRgDIAMoDjItLnByb3RvM19w", |
| "cmVzZXJ2ZV91bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtQgIQARJcChxy", |
| "ZXBlYXRlZF9wYWNrZWRfdW5leHBlY3RlZF9lGAQgAygOMjYucHJvdG8zX3By", |
| "ZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVzdC5NeUVudW1QbHVzRXh0cmES", |
| "QgoJb25lb2ZfZV8xGAUgASgOMi0ucHJvdG8zX3ByZXNlcnZlX3Vua25vd25f", |
| "ZW51bV91bml0dGVzdC5NeUVudW1IABJCCglvbmVvZl9lXzIYBiABKA4yLS5w", |
| "cm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bUgA", |
| "QgMKAW8i+wMKEk15TWVzc2FnZVBsdXNFeHRyYRJBCgFlGAEgASgOMjYucHJv", |
| "dG8zX3ByZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVzdC5NeUVudW1QbHVz", |
| "RXh0cmESSgoKcmVwZWF0ZWRfZRgCIAMoDjI2LnByb3RvM19wcmVzZXJ2ZV91", |
| "bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtUGx1c0V4dHJhElUKEXJlcGVh", |
| "dGVkX3BhY2tlZF9lGAMgAygOMjYucHJvdG8zX3ByZXNlcnZlX3Vua25vd25f", |
| "ZW51bV91bml0dGVzdC5NeUVudW1QbHVzRXh0cmFCAhABEmAKHHJlcGVhdGVk", |
| "X3BhY2tlZF91bmV4cGVjdGVkX2UYBCADKA4yNi5wcm90bzNfcHJlc2VydmVf", |
| "dW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bVBsdXNFeHRyYUICEAESSwoJ", |
| "b25lb2ZfZV8xGAUgASgOMjYucHJvdG8zX3ByZXNlcnZlX3Vua25vd25fZW51", |
| "bV91bml0dGVzdC5NeUVudW1QbHVzRXh0cmFIABJLCglvbmVvZl9lXzIYBiAB", |
| "KA4yNi5wcm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15", |
| "RW51bVBsdXNFeHRyYUgAQgMKAW8qIwoGTXlFbnVtEgcKA0ZPTxAAEgcKA0JB", |
| "UhABEgcKA0JBWhACKj8KD015RW51bVBsdXNFeHRyYRIJCgVFX0ZPTxAAEgkK", |
| "BUVfQkFSEAESCQoFRV9CQVoQAhILCgdFX0VYVFJBEANCJKoCIUdvb2dsZS5Q", |
| "cm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvc2IGcHJvdG8z")); |
| pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
| descriptor = root; |
| internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor = Descriptor.MessageTypes[0]; |
| internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable = |
| new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MyMessage, global::Google.ProtocolBuffers.TestProtos.MyMessage.Builder>(internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor, |
| new string[] { "E", "RepeatedE", "RepeatedPackedE", "RepeatedPackedUnexpectedE", "OneofE1", "OneofE2", }); |
| internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor = Descriptor.MessageTypes[1]; |
| internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__FieldAccessorTable = |
| new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra, global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.Builder>(internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor, |
| new string[] { "E", "RepeatedE", "RepeatedPackedE", "RepeatedPackedUnexpectedE", "OneofE1", "OneofE2", }); |
| pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
| RegisterAllExtensions(registry); |
| return registry; |
| }; |
| pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
| new pbd::FileDescriptor[] { |
| }, assigner); |
| } |
| #endregion |
| |
| } |
| #region Enums |
| public enum MyEnum { |
| FOO = 0, |
| BAR = 1, |
| BAZ = 2, |
| } |
| |
| public enum MyEnumPlusExtra { |
| E_FOO = 0, |
| E_BAR = 1, |
| E_BAZ = 2, |
| E_EXTRA = 3, |
| } |
| |
| #endregion |
| |
| #region Messages |
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| public sealed partial class MyMessage : pb::GeneratedMessage<MyMessage, MyMessage.Builder> { |
| private MyMessage() { } |
| private static readonly MyMessage defaultInstance = new MyMessage().MakeReadOnly(); |
| private static readonly string[] _myMessageFieldNames = new string[] { "e", "oneof_e_1", "oneof_e_2", "repeated_e", "repeated_packed_e", "repeated_packed_unexpected_e" }; |
| private static readonly uint[] _myMessageFieldTags = new uint[] { 8, 40, 48, 16, 26, 32 }; |
| public static MyMessage DefaultInstance { |
| get { return defaultInstance; } |
| } |
| |
| public override MyMessage DefaultInstanceForType { |
| get { return DefaultInstance; } |
| } |
| |
| protected override MyMessage ThisMessage { |
| get { return this; } |
| } |
| |
| public static pbd::MessageDescriptor Descriptor { |
| get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor; } |
| } |
| |
| protected override pb::FieldAccess.FieldAccessorTable<MyMessage, MyMessage.Builder> InternalFieldAccessors { |
| get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; } |
| } |
| |
| public const int EFieldNumber = 1; |
| private bool hasE; |
| private global::Google.ProtocolBuffers.TestProtos.MyEnum e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
| public bool HasE { |
| get { return hasE; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum E { |
| get { return e_; } |
| } |
| |
| public const int RepeatedEFieldNumber = 2; |
| private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> repeatedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum>(); |
| public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedEList { |
| get { return pbc::Lists.AsReadOnly(repeatedE_); } |
| } |
| public int RepeatedECount { |
| get { return repeatedE_.Count; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { |
| return repeatedE_[index]; |
| } |
| |
| public const int RepeatedPackedEFieldNumber = 3; |
| private int repeatedPackedEMemoizedSerializedSize; |
| private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> repeatedPackedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum>(); |
| public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedPackedEList { |
| get { return pbc::Lists.AsReadOnly(repeatedPackedE_); } |
| } |
| public int RepeatedPackedECount { |
| get { return repeatedPackedE_.Count; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { |
| return repeatedPackedE_[index]; |
| } |
| |
| public const int RepeatedPackedUnexpectedEFieldNumber = 4; |
| private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> repeatedPackedUnexpectedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(); |
| public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedPackedUnexpectedEList { |
| get { return pbc::Lists.AsReadOnly(repeatedPackedUnexpectedE_); } |
| } |
| public int RepeatedPackedUnexpectedECount { |
| get { return repeatedPackedUnexpectedE_.Count; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { |
| return repeatedPackedUnexpectedE_[index]; |
| } |
| |
| public const int OneofE1FieldNumber = 5; |
| private bool hasOneofE1; |
| private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
| public bool HasOneofE1 { |
| get { return hasOneofE1; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { |
| get { return oneofE1_; } |
| } |
| |
| public const int OneofE2FieldNumber = 6; |
| private bool hasOneofE2; |
| private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
| public bool HasOneofE2 { |
| get { return hasOneofE2; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { |
| get { return oneofE2_; } |
| } |
| |
| public override bool IsInitialized { |
| get { |
| return true; |
| } |
| } |
| |
| public override void WriteTo(pb::ICodedOutputStream output) { |
| CalcSerializedSize(); |
| string[] field_names = _myMessageFieldNames; |
| if (hasE) { |
| output.WriteEnum(1, field_names[0], (int) E, E); |
| } |
| if (repeatedE_.Count > 0) { |
| output.WriteEnumArray(2, field_names[3], repeatedE_); |
| } |
| if (repeatedPackedE_.Count > 0) { |
| output.WritePackedEnumArray(3, field_names[4], repeatedPackedEMemoizedSerializedSize, repeatedPackedE_); |
| } |
| if (repeatedPackedUnexpectedE_.Count > 0) { |
| output.WriteEnumArray(4, field_names[5], repeatedPackedUnexpectedE_); |
| } |
| if (hasOneofE1) { |
| output.WriteEnum(5, field_names[1], (int) OneofE1, OneofE1); |
| } |
| if (hasOneofE2) { |
| output.WriteEnum(6, field_names[2], (int) OneofE2, OneofE2); |
| } |
| UnknownFields.WriteTo(output); |
| } |
| |
| private int memoizedSerializedSize = -1; |
| public override int SerializedSize { |
| get { |
| int size = memoizedSerializedSize; |
| if (size != -1) return size; |
| return CalcSerializedSize(); |
| } |
| } |
| |
| private int CalcSerializedSize() { |
| int size = memoizedSerializedSize; |
| if (size != -1) return size; |
| |
| size = 0; |
| if (hasE) { |
| size += pb::CodedOutputStream.ComputeEnumSize(1, (int) E); |
| } |
| { |
| int dataSize = 0; |
| if (repeatedE_.Count > 0) { |
| foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedE_) { |
| dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
| } |
| size += dataSize; |
| size += 1 * repeatedE_.Count; |
| } |
| } |
| { |
| int dataSize = 0; |
| if (repeatedPackedE_.Count > 0) { |
| foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedPackedE_) { |
| dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
| } |
| size += dataSize; |
| size += 1; |
| size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); |
| } |
| repeatedPackedEMemoizedSerializedSize = dataSize; |
| } |
| { |
| int dataSize = 0; |
| if (repeatedPackedUnexpectedE_.Count > 0) { |
| foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedPackedUnexpectedE_) { |
| dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
| } |
| size += dataSize; |
| size += 1 * repeatedPackedUnexpectedE_.Count; |
| } |
| } |
| if (hasOneofE1) { |
| size += pb::CodedOutputStream.ComputeEnumSize(5, (int) OneofE1); |
| } |
| if (hasOneofE2) { |
| size += pb::CodedOutputStream.ComputeEnumSize(6, (int) OneofE2); |
| } |
| size += UnknownFields.SerializedSize; |
| memoizedSerializedSize = size; |
| return size; |
| } |
| public static MyMessage ParseFrom(pb::ByteString data) { |
| return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| } |
| public static MyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| } |
| public static MyMessage ParseFrom(byte[] data) { |
| return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| } |
| public static MyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| } |
| public static MyMessage ParseFrom(global::System.IO.Stream input) { |
| return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| } |
| public static MyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| } |
| public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
| return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
| } |
| public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
| } |
| public static MyMessage ParseFrom(pb::ICodedInputStream input) { |
| return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| } |
| public static MyMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| } |
| private MyMessage MakeReadOnly() { |
| repeatedE_.MakeReadOnly(); |
| repeatedPackedE_.MakeReadOnly(); |
| repeatedPackedUnexpectedE_.MakeReadOnly(); |
| return this; |
| } |
| |
| public static Builder CreateBuilder() { return new Builder(); } |
| public override Builder ToBuilder() { return CreateBuilder(this); } |
| public override Builder CreateBuilderForType() { return new Builder(); } |
| public static Builder CreateBuilder(MyMessage prototype) { |
| return new Builder(prototype); |
| } |
| |
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| public sealed partial class Builder : pb::GeneratedBuilder<MyMessage, Builder> { |
| protected override Builder ThisBuilder { |
| get { return this; } |
| } |
| public Builder() { |
| result = DefaultInstance; |
| resultIsReadOnly = true; |
| } |
| internal Builder(MyMessage cloneFrom) { |
| result = cloneFrom; |
| resultIsReadOnly = true; |
| } |
| |
| private bool resultIsReadOnly; |
| private MyMessage result; |
| |
| private MyMessage PrepareBuilder() { |
| if (resultIsReadOnly) { |
| MyMessage original = result; |
| result = new MyMessage(); |
| resultIsReadOnly = false; |
| MergeFrom(original); |
| } |
| return result; |
| } |
| |
| public override bool IsInitialized { |
| get { return result.IsInitialized; } |
| } |
| |
| protected override MyMessage MessageBeingBuilt { |
| get { return PrepareBuilder(); } |
| } |
| |
| public override Builder Clear() { |
| result = DefaultInstance; |
| resultIsReadOnly = true; |
| return this; |
| } |
| |
| public override Builder Clone() { |
| if (resultIsReadOnly) { |
| return new Builder(result); |
| } else { |
| return new Builder().MergeFrom(result); |
| } |
| } |
| |
| public override pbd::MessageDescriptor DescriptorForType { |
| get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.Descriptor; } |
| } |
| |
| public override MyMessage DefaultInstanceForType { |
| get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance; } |
| } |
| |
| public override MyMessage BuildPartial() { |
| if (resultIsReadOnly) { |
| return result; |
| } |
| resultIsReadOnly = true; |
| return result.MakeReadOnly(); |
| } |
| |
| public override Builder MergeFrom(pb::IMessage other) { |
| if (other is MyMessage) { |
| return MergeFrom((MyMessage) other); |
| } else { |
| base.MergeFrom(other); |
| return this; |
| } |
| } |
| |
| public override Builder MergeFrom(MyMessage other) { |
| if (other == global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance) return this; |
| PrepareBuilder(); |
| if (other.HasE) { |
| E = other.E; |
| } |
| if (other.repeatedE_.Count != 0) { |
| result.repeatedE_.Add(other.repeatedE_); |
| } |
| if (other.repeatedPackedE_.Count != 0) { |
| result.repeatedPackedE_.Add(other.repeatedPackedE_); |
| } |
| if (other.repeatedPackedUnexpectedE_.Count != 0) { |
| result.repeatedPackedUnexpectedE_.Add(other.repeatedPackedUnexpectedE_); |
| } |
| if (other.HasOneofE1) { |
| OneofE1 = other.OneofE1; |
| } |
| if (other.HasOneofE2) { |
| OneofE2 = other.OneofE2; |
| } |
| this.MergeUnknownFields(other.UnknownFields); |
| return this; |
| } |
| |
| public override Builder MergeFrom(pb::ICodedInputStream input) { |
| return MergeFrom(input, pb::ExtensionRegistry.Empty); |
| } |
| |
| public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| PrepareBuilder(); |
| pb::UnknownFieldSet.Builder unknownFields = null; |
| uint tag; |
| string field_name; |
| while (input.ReadTag(out tag, out field_name)) { |
| if(tag == 0 && field_name != null) { |
| int field_ordinal = global::System.Array.BinarySearch(_myMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
| if(field_ordinal >= 0) |
| tag = _myMessageFieldTags[field_ordinal]; |
| else { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
| continue; |
| } |
| } |
| switch (tag) { |
| case 0: { |
| throw pb::InvalidProtocolBufferException.InvalidTag(); |
| } |
| default: { |
| if (pb::WireFormat.IsEndGroupTag(tag)) { |
| if (unknownFields != null) { |
| this.UnknownFields = unknownFields.Build(); |
| } |
| return this; |
| } |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
| break; |
| } |
| case 8: { |
| object unknown; |
| if(input.ReadEnum(ref result.e_, out unknown)) { |
| result.hasE = true; |
| } else if(unknown is int) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| unknownFields.MergeVarintField(1, (ulong)(int)unknown); |
| } |
| break; |
| } |
| case 18: |
| case 16: { |
| scg::ICollection<object> unknownItems; |
| input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnum>(tag, field_name, result.repeatedE_, out unknownItems); |
| if (unknownItems != null) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| foreach (object rawValue in unknownItems) |
| if (rawValue is int) |
| unknownFields.MergeVarintField(2, (ulong)(int)rawValue); |
| } |
| break; |
| } |
| case 26: |
| case 24: { |
| scg::ICollection<object> unknownItems; |
| input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnum>(tag, field_name, result.repeatedPackedE_, out unknownItems); |
| if (unknownItems != null) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| foreach (object rawValue in unknownItems) |
| if (rawValue is int) |
| unknownFields.MergeVarintField(3, (ulong)(int)rawValue); |
| } |
| break; |
| } |
| case 34: |
| case 32: { |
| scg::ICollection<object> unknownItems; |
| input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(tag, field_name, result.repeatedPackedUnexpectedE_, out unknownItems); |
| if (unknownItems != null) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| foreach (object rawValue in unknownItems) |
| if (rawValue is int) |
| unknownFields.MergeVarintField(4, (ulong)(int)rawValue); |
| } |
| break; |
| } |
| case 40: { |
| object unknown; |
| if(input.ReadEnum(ref result.oneofE1_, out unknown)) { |
| result.hasOneofE1 = true; |
| } else if(unknown is int) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| unknownFields.MergeVarintField(5, (ulong)(int)unknown); |
| } |
| break; |
| } |
| case 48: { |
| object unknown; |
| if(input.ReadEnum(ref result.oneofE2_, out unknown)) { |
| result.hasOneofE2 = true; |
| } else if(unknown is int) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| unknownFields.MergeVarintField(6, (ulong)(int)unknown); |
| } |
| break; |
| } |
| } |
| } |
| |
| if (unknownFields != null) { |
| this.UnknownFields = unknownFields.Build(); |
| } |
| return this; |
| } |
| |
| |
| public bool HasE { |
| get { return result.hasE; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum E { |
| get { return result.E; } |
| set { SetE(value); } |
| } |
| public Builder SetE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
| PrepareBuilder(); |
| result.hasE = true; |
| result.e_ = value; |
| return this; |
| } |
| public Builder ClearE() { |
| PrepareBuilder(); |
| result.hasE = false; |
| result.e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
| return this; |
| } |
| |
| public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedEList { |
| get { return PrepareBuilder().repeatedE_; } |
| } |
| public int RepeatedECount { |
| get { return result.RepeatedECount; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { |
| return result.GetRepeatedE(index); |
| } |
| public Builder SetRepeatedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
| PrepareBuilder(); |
| result.repeatedE_[index] = value; |
| return this; |
| } |
| public Builder AddRepeatedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
| PrepareBuilder(); |
| result.repeatedE_.Add(value); |
| return this; |
| } |
| public Builder AddRangeRepeatedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnum> values) { |
| PrepareBuilder(); |
| result.repeatedE_.Add(values); |
| return this; |
| } |
| public Builder ClearRepeatedE() { |
| PrepareBuilder(); |
| result.repeatedE_.Clear(); |
| return this; |
| } |
| |
| public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedPackedEList { |
| get { return PrepareBuilder().repeatedPackedE_; } |
| } |
| public int RepeatedPackedECount { |
| get { return result.RepeatedPackedECount; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { |
| return result.GetRepeatedPackedE(index); |
| } |
| public Builder SetRepeatedPackedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
| PrepareBuilder(); |
| result.repeatedPackedE_[index] = value; |
| return this; |
| } |
| public Builder AddRepeatedPackedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
| PrepareBuilder(); |
| result.repeatedPackedE_.Add(value); |
| return this; |
| } |
| public Builder AddRangeRepeatedPackedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnum> values) { |
| PrepareBuilder(); |
| result.repeatedPackedE_.Add(values); |
| return this; |
| } |
| public Builder ClearRepeatedPackedE() { |
| PrepareBuilder(); |
| result.repeatedPackedE_.Clear(); |
| return this; |
| } |
| |
| public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedPackedUnexpectedEList { |
| get { return PrepareBuilder().repeatedPackedUnexpectedE_; } |
| } |
| public int RepeatedPackedUnexpectedECount { |
| get { return result.RepeatedPackedUnexpectedECount; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { |
| return result.GetRepeatedPackedUnexpectedE(index); |
| } |
| public Builder SetRepeatedPackedUnexpectedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_[index] = value; |
| return this; |
| } |
| public Builder AddRepeatedPackedUnexpectedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_.Add(value); |
| return this; |
| } |
| public Builder AddRangeRepeatedPackedUnexpectedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> values) { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_.Add(values); |
| return this; |
| } |
| public Builder ClearRepeatedPackedUnexpectedE() { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_.Clear(); |
| return this; |
| } |
| |
| public bool HasOneofE1 { |
| get { return result.hasOneofE1; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { |
| get { return result.OneofE1; } |
| set { SetOneofE1(value); } |
| } |
| public Builder SetOneofE1(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
| PrepareBuilder(); |
| result.hasOneofE1 = true; |
| result.oneofE1_ = value; |
| return this; |
| } |
| public Builder ClearOneofE1() { |
| PrepareBuilder(); |
| result.hasOneofE1 = false; |
| result.oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
| return this; |
| } |
| |
| public bool HasOneofE2 { |
| get { return result.hasOneofE2; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { |
| get { return result.OneofE2; } |
| set { SetOneofE2(value); } |
| } |
| public Builder SetOneofE2(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
| PrepareBuilder(); |
| result.hasOneofE2 = true; |
| result.oneofE2_ = value; |
| return this; |
| } |
| public Builder ClearOneofE2() { |
| PrepareBuilder(); |
| result.hasOneofE2 = false; |
| result.oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
| return this; |
| } |
| } |
| static MyMessage() { |
| object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.Descriptor, null); |
| } |
| } |
| |
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| public sealed partial class MyMessagePlusExtra : pb::GeneratedMessage<MyMessagePlusExtra, MyMessagePlusExtra.Builder> { |
| private MyMessagePlusExtra() { } |
| private static readonly MyMessagePlusExtra defaultInstance = new MyMessagePlusExtra().MakeReadOnly(); |
| private static readonly string[] _myMessagePlusExtraFieldNames = new string[] { "e", "oneof_e_1", "oneof_e_2", "repeated_e", "repeated_packed_e", "repeated_packed_unexpected_e" }; |
| private static readonly uint[] _myMessagePlusExtraFieldTags = new uint[] { 8, 40, 48, 16, 26, 34 }; |
| public static MyMessagePlusExtra DefaultInstance { |
| get { return defaultInstance; } |
| } |
| |
| public override MyMessagePlusExtra DefaultInstanceForType { |
| get { return DefaultInstance; } |
| } |
| |
| protected override MyMessagePlusExtra ThisMessage { |
| get { return this; } |
| } |
| |
| public static pbd::MessageDescriptor Descriptor { |
| get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor; } |
| } |
| |
| protected override pb::FieldAccess.FieldAccessorTable<MyMessagePlusExtra, MyMessagePlusExtra.Builder> InternalFieldAccessors { |
| get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__FieldAccessorTable; } |
| } |
| |
| public const int EFieldNumber = 1; |
| private bool hasE; |
| private global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra e_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; |
| public bool HasE { |
| get { return hasE; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra E { |
| get { return e_; } |
| } |
| |
| public const int RepeatedEFieldNumber = 2; |
| private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> repeatedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(); |
| public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedEList { |
| get { return pbc::Lists.AsReadOnly(repeatedE_); } |
| } |
| public int RepeatedECount { |
| get { return repeatedE_.Count; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedE(int index) { |
| return repeatedE_[index]; |
| } |
| |
| public const int RepeatedPackedEFieldNumber = 3; |
| private int repeatedPackedEMemoizedSerializedSize; |
| private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> repeatedPackedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(); |
| public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedPackedEList { |
| get { return pbc::Lists.AsReadOnly(repeatedPackedE_); } |
| } |
| public int RepeatedPackedECount { |
| get { return repeatedPackedE_.Count; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedE(int index) { |
| return repeatedPackedE_[index]; |
| } |
| |
| public const int RepeatedPackedUnexpectedEFieldNumber = 4; |
| private int repeatedPackedUnexpectedEMemoizedSerializedSize; |
| private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> repeatedPackedUnexpectedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(); |
| public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedPackedUnexpectedEList { |
| get { return pbc::Lists.AsReadOnly(repeatedPackedUnexpectedE_); } |
| } |
| public int RepeatedPackedUnexpectedECount { |
| get { return repeatedPackedUnexpectedE_.Count; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { |
| return repeatedPackedUnexpectedE_[index]; |
| } |
| |
| public const int OneofE1FieldNumber = 5; |
| private bool hasOneofE1; |
| private global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; |
| public bool HasOneofE1 { |
| get { return hasOneofE1; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE1 { |
| get { return oneofE1_; } |
| } |
| |
| public const int OneofE2FieldNumber = 6; |
| private bool hasOneofE2; |
| private global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; |
| public bool HasOneofE2 { |
| get { return hasOneofE2; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE2 { |
| get { return oneofE2_; } |
| } |
| |
| public override bool IsInitialized { |
| get { |
| return true; |
| } |
| } |
| |
| public override void WriteTo(pb::ICodedOutputStream output) { |
| CalcSerializedSize(); |
| string[] field_names = _myMessagePlusExtraFieldNames; |
| if (hasE) { |
| output.WriteEnum(1, field_names[0], (int) E, E); |
| } |
| if (repeatedE_.Count > 0) { |
| output.WriteEnumArray(2, field_names[3], repeatedE_); |
| } |
| if (repeatedPackedE_.Count > 0) { |
| output.WritePackedEnumArray(3, field_names[4], repeatedPackedEMemoizedSerializedSize, repeatedPackedE_); |
| } |
| if (repeatedPackedUnexpectedE_.Count > 0) { |
| output.WritePackedEnumArray(4, field_names[5], repeatedPackedUnexpectedEMemoizedSerializedSize, repeatedPackedUnexpectedE_); |
| } |
| if (hasOneofE1) { |
| output.WriteEnum(5, field_names[1], (int) OneofE1, OneofE1); |
| } |
| if (hasOneofE2) { |
| output.WriteEnum(6, field_names[2], (int) OneofE2, OneofE2); |
| } |
| UnknownFields.WriteTo(output); |
| } |
| |
| private int memoizedSerializedSize = -1; |
| public override int SerializedSize { |
| get { |
| int size = memoizedSerializedSize; |
| if (size != -1) return size; |
| return CalcSerializedSize(); |
| } |
| } |
| |
| private int CalcSerializedSize() { |
| int size = memoizedSerializedSize; |
| if (size != -1) return size; |
| |
| size = 0; |
| if (hasE) { |
| size += pb::CodedOutputStream.ComputeEnumSize(1, (int) E); |
| } |
| { |
| int dataSize = 0; |
| if (repeatedE_.Count > 0) { |
| foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedE_) { |
| dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
| } |
| size += dataSize; |
| size += 1 * repeatedE_.Count; |
| } |
| } |
| { |
| int dataSize = 0; |
| if (repeatedPackedE_.Count > 0) { |
| foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedPackedE_) { |
| dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
| } |
| size += dataSize; |
| size += 1; |
| size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); |
| } |
| repeatedPackedEMemoizedSerializedSize = dataSize; |
| } |
| { |
| int dataSize = 0; |
| if (repeatedPackedUnexpectedE_.Count > 0) { |
| foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedPackedUnexpectedE_) { |
| dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
| } |
| size += dataSize; |
| size += 1; |
| size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); |
| } |
| repeatedPackedUnexpectedEMemoizedSerializedSize = dataSize; |
| } |
| if (hasOneofE1) { |
| size += pb::CodedOutputStream.ComputeEnumSize(5, (int) OneofE1); |
| } |
| if (hasOneofE2) { |
| size += pb::CodedOutputStream.ComputeEnumSize(6, (int) OneofE2); |
| } |
| size += UnknownFields.SerializedSize; |
| memoizedSerializedSize = size; |
| return size; |
| } |
| public static MyMessagePlusExtra ParseFrom(pb::ByteString data) { |
| return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseFrom(byte[] data) { |
| return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseFrom(global::System.IO.Stream input) { |
| return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseDelimitedFrom(global::System.IO.Stream input) { |
| return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseFrom(pb::ICodedInputStream input) { |
| return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| } |
| public static MyMessagePlusExtra ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| } |
| private MyMessagePlusExtra MakeReadOnly() { |
| repeatedE_.MakeReadOnly(); |
| repeatedPackedE_.MakeReadOnly(); |
| repeatedPackedUnexpectedE_.MakeReadOnly(); |
| return this; |
| } |
| |
| public static Builder CreateBuilder() { return new Builder(); } |
| public override Builder ToBuilder() { return CreateBuilder(this); } |
| public override Builder CreateBuilderForType() { return new Builder(); } |
| public static Builder CreateBuilder(MyMessagePlusExtra prototype) { |
| return new Builder(prototype); |
| } |
| |
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| public sealed partial class Builder : pb::GeneratedBuilder<MyMessagePlusExtra, Builder> { |
| protected override Builder ThisBuilder { |
| get { return this; } |
| } |
| public Builder() { |
| result = DefaultInstance; |
| resultIsReadOnly = true; |
| } |
| internal Builder(MyMessagePlusExtra cloneFrom) { |
| result = cloneFrom; |
| resultIsReadOnly = true; |
| } |
| |
| private bool resultIsReadOnly; |
| private MyMessagePlusExtra result; |
| |
| private MyMessagePlusExtra PrepareBuilder() { |
| if (resultIsReadOnly) { |
| MyMessagePlusExtra original = result; |
| result = new MyMessagePlusExtra(); |
| resultIsReadOnly = false; |
| MergeFrom(original); |
| } |
| return result; |
| } |
| |
| public override bool IsInitialized { |
| get { return result.IsInitialized; } |
| } |
| |
| protected override MyMessagePlusExtra MessageBeingBuilt { |
| get { return PrepareBuilder(); } |
| } |
| |
| public override Builder Clear() { |
| result = DefaultInstance; |
| resultIsReadOnly = true; |
| return this; |
| } |
| |
| public override Builder Clone() { |
| if (resultIsReadOnly) { |
| return new Builder(result); |
| } else { |
| return new Builder().MergeFrom(result); |
| } |
| } |
| |
| public override pbd::MessageDescriptor DescriptorForType { |
| get { return global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.Descriptor; } |
| } |
| |
| public override MyMessagePlusExtra DefaultInstanceForType { |
| get { return global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.DefaultInstance; } |
| } |
| |
| public override MyMessagePlusExtra BuildPartial() { |
| if (resultIsReadOnly) { |
| return result; |
| } |
| resultIsReadOnly = true; |
| return result.MakeReadOnly(); |
| } |
| |
| public override Builder MergeFrom(pb::IMessage other) { |
| if (other is MyMessagePlusExtra) { |
| return MergeFrom((MyMessagePlusExtra) other); |
| } else { |
| base.MergeFrom(other); |
| return this; |
| } |
| } |
| |
| public override Builder MergeFrom(MyMessagePlusExtra other) { |
| if (other == global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.DefaultInstance) return this; |
| PrepareBuilder(); |
| if (other.HasE) { |
| E = other.E; |
| } |
| if (other.repeatedE_.Count != 0) { |
| result.repeatedE_.Add(other.repeatedE_); |
| } |
| if (other.repeatedPackedE_.Count != 0) { |
| result.repeatedPackedE_.Add(other.repeatedPackedE_); |
| } |
| if (other.repeatedPackedUnexpectedE_.Count != 0) { |
| result.repeatedPackedUnexpectedE_.Add(other.repeatedPackedUnexpectedE_); |
| } |
| if (other.HasOneofE1) { |
| OneofE1 = other.OneofE1; |
| } |
| if (other.HasOneofE2) { |
| OneofE2 = other.OneofE2; |
| } |
| this.MergeUnknownFields(other.UnknownFields); |
| return this; |
| } |
| |
| public override Builder MergeFrom(pb::ICodedInputStream input) { |
| return MergeFrom(input, pb::ExtensionRegistry.Empty); |
| } |
| |
| public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| PrepareBuilder(); |
| pb::UnknownFieldSet.Builder unknownFields = null; |
| uint tag; |
| string field_name; |
| while (input.ReadTag(out tag, out field_name)) { |
| if(tag == 0 && field_name != null) { |
| int field_ordinal = global::System.Array.BinarySearch(_myMessagePlusExtraFieldNames, field_name, global::System.StringComparer.Ordinal); |
| if(field_ordinal >= 0) |
| tag = _myMessagePlusExtraFieldTags[field_ordinal]; |
| else { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
| continue; |
| } |
| } |
| switch (tag) { |
| case 0: { |
| throw pb::InvalidProtocolBufferException.InvalidTag(); |
| } |
| default: { |
| if (pb::WireFormat.IsEndGroupTag(tag)) { |
| if (unknownFields != null) { |
| this.UnknownFields = unknownFields.Build(); |
| } |
| return this; |
| } |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
| break; |
| } |
| case 8: { |
| object unknown; |
| if(input.ReadEnum(ref result.e_, out unknown)) { |
| result.hasE = true; |
| } else if(unknown is int) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| unknownFields.MergeVarintField(1, (ulong)(int)unknown); |
| } |
| break; |
| } |
| case 18: |
| case 16: { |
| scg::ICollection<object> unknownItems; |
| input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(tag, field_name, result.repeatedE_, out unknownItems); |
| if (unknownItems != null) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| foreach (object rawValue in unknownItems) |
| if (rawValue is int) |
| unknownFields.MergeVarintField(2, (ulong)(int)rawValue); |
| } |
| break; |
| } |
| case 26: |
| case 24: { |
| scg::ICollection<object> unknownItems; |
| input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(tag, field_name, result.repeatedPackedE_, out unknownItems); |
| if (unknownItems != null) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| foreach (object rawValue in unknownItems) |
| if (rawValue is int) |
| unknownFields.MergeVarintField(3, (ulong)(int)rawValue); |
| } |
| break; |
| } |
| case 34: |
| case 32: { |
| scg::ICollection<object> unknownItems; |
| input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra>(tag, field_name, result.repeatedPackedUnexpectedE_, out unknownItems); |
| if (unknownItems != null) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| foreach (object rawValue in unknownItems) |
| if (rawValue is int) |
| unknownFields.MergeVarintField(4, (ulong)(int)rawValue); |
| } |
| break; |
| } |
| case 40: { |
| object unknown; |
| if(input.ReadEnum(ref result.oneofE1_, out unknown)) { |
| result.hasOneofE1 = true; |
| } else if(unknown is int) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| unknownFields.MergeVarintField(5, (ulong)(int)unknown); |
| } |
| break; |
| } |
| case 48: { |
| object unknown; |
| if(input.ReadEnum(ref result.oneofE2_, out unknown)) { |
| result.hasOneofE2 = true; |
| } else if(unknown is int) { |
| if (unknownFields == null) { |
| unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| } |
| unknownFields.MergeVarintField(6, (ulong)(int)unknown); |
| } |
| break; |
| } |
| } |
| } |
| |
| if (unknownFields != null) { |
| this.UnknownFields = unknownFields.Build(); |
| } |
| return this; |
| } |
| |
| |
| public bool HasE { |
| get { return result.hasE; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra E { |
| get { return result.E; } |
| set { SetE(value); } |
| } |
| public Builder SetE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.hasE = true; |
| result.e_ = value; |
| return this; |
| } |
| public Builder ClearE() { |
| PrepareBuilder(); |
| result.hasE = false; |
| result.e_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; |
| return this; |
| } |
| |
| public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedEList { |
| get { return PrepareBuilder().repeatedE_; } |
| } |
| public int RepeatedECount { |
| get { return result.RepeatedECount; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedE(int index) { |
| return result.GetRepeatedE(index); |
| } |
| public Builder SetRepeatedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedE_[index] = value; |
| return this; |
| } |
| public Builder AddRepeatedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedE_.Add(value); |
| return this; |
| } |
| public Builder AddRangeRepeatedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> values) { |
| PrepareBuilder(); |
| result.repeatedE_.Add(values); |
| return this; |
| } |
| public Builder ClearRepeatedE() { |
| PrepareBuilder(); |
| result.repeatedE_.Clear(); |
| return this; |
| } |
| |
| public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedPackedEList { |
| get { return PrepareBuilder().repeatedPackedE_; } |
| } |
| public int RepeatedPackedECount { |
| get { return result.RepeatedPackedECount; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedE(int index) { |
| return result.GetRepeatedPackedE(index); |
| } |
| public Builder SetRepeatedPackedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedPackedE_[index] = value; |
| return this; |
| } |
| public Builder AddRepeatedPackedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedPackedE_.Add(value); |
| return this; |
| } |
| public Builder AddRangeRepeatedPackedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> values) { |
| PrepareBuilder(); |
| result.repeatedPackedE_.Add(values); |
| return this; |
| } |
| public Builder ClearRepeatedPackedE() { |
| PrepareBuilder(); |
| result.repeatedPackedE_.Clear(); |
| return this; |
| } |
| |
| public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> RepeatedPackedUnexpectedEList { |
| get { return PrepareBuilder().repeatedPackedUnexpectedE_; } |
| } |
| public int RepeatedPackedUnexpectedECount { |
| get { return result.RepeatedPackedUnexpectedECount; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { |
| return result.GetRepeatedPackedUnexpectedE(index); |
| } |
| public Builder SetRepeatedPackedUnexpectedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_[index] = value; |
| return this; |
| } |
| public Builder AddRepeatedPackedUnexpectedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_.Add(value); |
| return this; |
| } |
| public Builder AddRangeRepeatedPackedUnexpectedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra> values) { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_.Add(values); |
| return this; |
| } |
| public Builder ClearRepeatedPackedUnexpectedE() { |
| PrepareBuilder(); |
| result.repeatedPackedUnexpectedE_.Clear(); |
| return this; |
| } |
| |
| public bool HasOneofE1 { |
| get { return result.hasOneofE1; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE1 { |
| get { return result.OneofE1; } |
| set { SetOneofE1(value); } |
| } |
| public Builder SetOneofE1(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.hasOneofE1 = true; |
| result.oneofE1_ = value; |
| return this; |
| } |
| public Builder ClearOneofE1() { |
| PrepareBuilder(); |
| result.hasOneofE1 = false; |
| result.oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; |
| return this; |
| } |
| |
| public bool HasOneofE2 { |
| get { return result.hasOneofE2; } |
| } |
| public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE2 { |
| get { return result.OneofE2; } |
| set { SetOneofE2(value); } |
| } |
| public Builder SetOneofE2(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { |
| PrepareBuilder(); |
| result.hasOneofE2 = true; |
| result.oneofE2_ = value; |
| return this; |
| } |
| public Builder ClearOneofE2() { |
| PrepareBuilder(); |
| result.hasOneofE2 = false; |
| result.oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; |
| return this; |
| } |
| } |
| static MyMessagePlusExtra() { |
| object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.Descriptor, null); |
| } |
| } |
| |
| #endregion |
| |
| } |
| |
| #endregion Designer generated code |