csharptest | 35b6852 | 2011-05-20 12:22:21 -0500 | [diff] [blame] | 1 | // Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT!
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 2 |
|
| 3 | using pb = global::Google.ProtocolBuffers;
|
| 4 | using pbc = global::Google.ProtocolBuffers.Collections;
|
| 5 | using pbd = global::Google.ProtocolBuffers.Descriptors;
|
| 6 | using scg = global::System.Collections.Generic;
|
| 7 | namespace Google.ProtocolBuffers.Examples.AddressBook {
|
| 8 |
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 9 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 10 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 11 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 12 | public static partial class AddressBookProtos {
|
| 13 |
|
| 14 | #region Extension registration
|
| 15 | public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
|
| 16 | }
|
| 17 | #endregion
|
| 18 | #region Static variables
|
| 19 | internal static pbd::MessageDescriptor internal__static_tutorial_Person__Descriptor;
|
| 20 | internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.Examples.AddressBook.Person, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder> internal__static_tutorial_Person__FieldAccessorTable;
|
| 21 | internal static pbd::MessageDescriptor internal__static_tutorial_Person_PhoneNumber__Descriptor;
|
| 22 | internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder> internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable;
|
| 23 | internal static pbd::MessageDescriptor internal__static_tutorial_AddressBook__Descriptor;
|
| 24 | internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook, global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.Builder> internal__static_tutorial_AddressBook__FieldAccessorTable;
|
| 25 | #endregion
|
| 26 | #region Descriptor
|
| 27 | public static pbd::FileDescriptor Descriptor {
|
| 28 | get { return descriptor; }
|
| 29 | }
|
| 30 | private static pbd::FileDescriptor descriptor;
|
| 31 |
|
| 32 | static AddressBookProtos() {
|
| 33 | byte[] descriptorData = global::System.Convert.FromBase64String(
|
| 34 | "Chp0dXRvcmlhbC9hZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaJGdvb2ds" +
|
| 35 | "ZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90byLaAQoGUGVyc29uEgwK" +
|
| 36 | "BG5hbWUYASACKAkSCgoCaWQYAiACKAUSDQoFZW1haWwYAyABKAkSKwoFcGhv" +
|
| 37 | "bmUYBCADKAsyHC50dXRvcmlhbC5QZXJzb24uUGhvbmVOdW1iZXIaTQoLUGhv" +
|
| 38 | "bmVOdW1iZXISDgoGbnVtYmVyGAEgAigJEi4KBHR5cGUYAiABKA4yGi50dXRv" +
|
| 39 | "cmlhbC5QZXJzb24uUGhvbmVUeXBlOgRIT01FIisKCVBob25lVHlwZRIKCgZN" +
|
| 40 | "T0JJTEUQABIICgRIT01FEAESCAoEV09SSxACIi8KC0FkZHJlc3NCb29rEiAK" +
|
| 41 | "BnBlcnNvbhgBIAMoCzIQLnR1dG9yaWFsLlBlcnNvbkJFSAHCPkAKK0dvb2ds" +
|
| 42 | "ZS5Qcm90b2NvbEJ1ZmZlcnMuRXhhbXBsZXMuQWRkcmVzc0Jvb2sSEUFkZHJl" +
|
| 43 | "c3NCb29rUHJvdG9z");
|
| 44 | pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
|
| 45 | descriptor = root;
|
| 46 | internal__static_tutorial_Person__Descriptor = Descriptor.MessageTypes[0];
|
| 47 | internal__static_tutorial_Person__FieldAccessorTable =
|
| 48 | new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.Examples.AddressBook.Person, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder>(internal__static_tutorial_Person__Descriptor,
|
| 49 | new string[] { "Name", "Id", "Email", "Phone", });
|
| 50 | internal__static_tutorial_Person_PhoneNumber__Descriptor = internal__static_tutorial_Person__Descriptor.NestedTypes[0];
|
| 51 | internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable =
|
| 52 | new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder>(internal__static_tutorial_Person_PhoneNumber__Descriptor,
|
| 53 | new string[] { "Number", "Type", });
|
| 54 | internal__static_tutorial_AddressBook__Descriptor = Descriptor.MessageTypes[1];
|
| 55 | internal__static_tutorial_AddressBook__FieldAccessorTable =
|
| 56 | new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook, global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.Builder>(internal__static_tutorial_AddressBook__Descriptor,
|
| 57 | new string[] { "Person", });
|
| 58 | pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
|
| 59 | RegisterAllExtensions(registry);
|
| 60 | global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry);
|
| 61 | return registry;
|
| 62 | };
|
| 63 | pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
|
| 64 | new pbd::FileDescriptor[] {
|
| 65 | global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
|
| 66 | }, assigner);
|
| 67 | }
|
| 68 | #endregion
|
| 69 |
|
| 70 | }
|
| 71 | #region Messages
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 72 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 73 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 74 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 75 | public sealed partial class Person : pb::GeneratedMessage<Person, Person.Builder> {
|
| 76 | private static readonly Person defaultInstance = new Builder().BuildPartial();
|
| 77 | public static Person DefaultInstance {
|
| 78 | get { return defaultInstance; }
|
| 79 | }
|
| 80 |
|
| 81 | public override Person DefaultInstanceForType {
|
| 82 | get { return defaultInstance; }
|
| 83 | }
|
| 84 |
|
| 85 | protected override Person ThisMessage {
|
| 86 | get { return this; }
|
| 87 | }
|
| 88 |
|
| 89 | public static pbd::MessageDescriptor Descriptor {
|
| 90 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person__Descriptor; }
|
| 91 | }
|
| 92 |
|
| 93 | protected override pb::FieldAccess.FieldAccessorTable<Person, Person.Builder> InternalFieldAccessors {
|
| 94 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person__FieldAccessorTable; }
|
| 95 | }
|
| 96 |
|
| 97 | #region Nested types
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 98 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 99 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 100 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 101 | public static class Types {
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 102 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 103 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 104 | public enum PhoneType {
|
| 105 | MOBILE = 0,
|
| 106 | HOME = 1,
|
| 107 | WORK = 2,
|
| 108 | }
|
| 109 |
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 110 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 111 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 112 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 113 | public sealed partial class PhoneNumber : pb::GeneratedMessage<PhoneNumber, PhoneNumber.Builder> {
|
| 114 | private static readonly PhoneNumber defaultInstance = new Builder().BuildPartial();
|
| 115 | public static PhoneNumber DefaultInstance {
|
| 116 | get { return defaultInstance; }
|
| 117 | }
|
| 118 |
|
| 119 | public override PhoneNumber DefaultInstanceForType {
|
| 120 | get { return defaultInstance; }
|
| 121 | }
|
| 122 |
|
| 123 | protected override PhoneNumber ThisMessage {
|
| 124 | get { return this; }
|
| 125 | }
|
| 126 |
|
| 127 | public static pbd::MessageDescriptor Descriptor {
|
| 128 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person_PhoneNumber__Descriptor; }
|
| 129 | }
|
| 130 |
|
| 131 | protected override pb::FieldAccess.FieldAccessorTable<PhoneNumber, PhoneNumber.Builder> InternalFieldAccessors {
|
| 132 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; }
|
| 133 | }
|
| 134 |
|
| 135 | public const int NumberFieldNumber = 1;
|
| 136 | private bool hasNumber;
|
| 137 | private string number_ = "";
|
| 138 | public bool HasNumber {
|
| 139 | get { return hasNumber; }
|
| 140 | }
|
| 141 | public string Number {
|
| 142 | get { return number_; }
|
| 143 | }
|
| 144 |
|
| 145 | public const int TypeFieldNumber = 2;
|
| 146 | private bool hasType;
|
| 147 | private global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME;
|
| 148 | public bool HasType {
|
| 149 | get { return hasType; }
|
| 150 | }
|
| 151 | public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type {
|
| 152 | get { return type_; }
|
| 153 | }
|
| 154 |
|
| 155 | public override bool IsInitialized {
|
| 156 | get {
|
| 157 | if (!hasNumber) return false;
|
| 158 | return true;
|
| 159 | }
|
| 160 | }
|
| 161 |
|
| 162 | public override void WriteTo(pb::CodedOutputStream output) {
|
| 163 | int size = SerializedSize;
|
| 164 | if (HasNumber) {
|
| 165 | output.WriteString(1, Number);
|
| 166 | }
|
| 167 | if (HasType) {
|
| 168 | output.WriteEnum(2, (int) Type);
|
| 169 | }
|
| 170 | UnknownFields.WriteTo(output);
|
| 171 | }
|
| 172 |
|
| 173 | private int memoizedSerializedSize = -1;
|
| 174 | public override int SerializedSize {
|
| 175 | get {
|
| 176 | int size = memoizedSerializedSize;
|
| 177 | if (size != -1) return size;
|
| 178 |
|
| 179 | size = 0;
|
| 180 | if (HasNumber) {
|
| 181 | size += pb::CodedOutputStream.ComputeStringSize(1, Number);
|
| 182 | }
|
| 183 | if (HasType) {
|
| 184 | size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type);
|
| 185 | }
|
| 186 | size += UnknownFields.SerializedSize;
|
| 187 | memoizedSerializedSize = size;
|
| 188 | return size;
|
| 189 | }
|
| 190 | }
|
| 191 |
|
| 192 | public static PhoneNumber ParseFrom(pb::ByteString data) {
|
| 193 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 194 | }
|
| 195 | public static PhoneNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
| 196 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 197 | }
|
| 198 | public static PhoneNumber ParseFrom(byte[] data) {
|
| 199 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 200 | }
|
| 201 | public static PhoneNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
| 202 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 203 | }
|
| 204 | public static PhoneNumber ParseFrom(global::System.IO.Stream input) {
|
| 205 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 206 | }
|
| 207 | public static PhoneNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 208 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 209 | }
|
| 210 | public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input) {
|
| 211 | return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
| 212 | }
|
| 213 | public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 214 | return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
| 215 | }
|
| 216 | public static PhoneNumber ParseFrom(pb::CodedInputStream input) {
|
| 217 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 218 | }
|
| 219 | public static PhoneNumber ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 220 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 221 | }
|
| 222 | public static Builder CreateBuilder() { return new Builder(); }
|
| 223 | public override Builder ToBuilder() { return CreateBuilder(this); }
|
| 224 | public override Builder CreateBuilderForType() { return new Builder(); }
|
| 225 | public static Builder CreateBuilder(PhoneNumber prototype) {
|
| 226 | return (Builder) new Builder().MergeFrom(prototype);
|
| 227 | }
|
| 228 |
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 229 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 230 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 231 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 232 | public sealed partial class Builder : pb::GeneratedBuilder<PhoneNumber, Builder> {
|
| 233 | protected override Builder ThisBuilder {
|
| 234 | get { return this; }
|
| 235 | }
|
| 236 | public Builder() {}
|
| 237 |
|
| 238 | PhoneNumber result = new PhoneNumber();
|
| 239 |
|
| 240 | protected override PhoneNumber MessageBeingBuilt {
|
| 241 | get { return result; }
|
| 242 | }
|
| 243 |
|
| 244 | public override Builder Clear() {
|
| 245 | result = new PhoneNumber();
|
| 246 | return this;
|
| 247 | }
|
| 248 |
|
| 249 | public override Builder Clone() {
|
| 250 | return new Builder().MergeFrom(result);
|
| 251 | }
|
| 252 |
|
| 253 | public override pbd::MessageDescriptor DescriptorForType {
|
| 254 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Descriptor; }
|
| 255 | }
|
| 256 |
|
| 257 | public override PhoneNumber DefaultInstanceForType {
|
| 258 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance; }
|
| 259 | }
|
| 260 |
|
| 261 | public override PhoneNumber BuildPartial() {
|
| 262 | if (result == null) {
|
| 263 | throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
| 264 | }
|
| 265 | PhoneNumber returnMe = result;
|
| 266 | result = null;
|
| 267 | return returnMe;
|
| 268 | }
|
| 269 |
|
| 270 | public override Builder MergeFrom(pb::IMessage other) {
|
| 271 | if (other is PhoneNumber) {
|
| 272 | return MergeFrom((PhoneNumber) other);
|
| 273 | } else {
|
| 274 | base.MergeFrom(other);
|
| 275 | return this;
|
| 276 | }
|
| 277 | }
|
| 278 |
|
| 279 | public override Builder MergeFrom(PhoneNumber other) {
|
| 280 | if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance) return this;
|
| 281 | if (other.HasNumber) {
|
| 282 | Number = other.Number;
|
| 283 | }
|
| 284 | if (other.HasType) {
|
| 285 | Type = other.Type;
|
| 286 | }
|
| 287 | this.MergeUnknownFields(other.UnknownFields);
|
| 288 | return this;
|
| 289 | }
|
| 290 |
|
| 291 | public override Builder MergeFrom(pb::CodedInputStream input) {
|
| 292 | return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
| 293 | }
|
| 294 |
|
| 295 | public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 296 | pb::UnknownFieldSet.Builder unknownFields = null;
|
| 297 | while (true) {
|
| 298 | uint tag = input.ReadTag();
|
| 299 | switch (tag) {
|
| 300 | case 0: {
|
| 301 | if (unknownFields != null) {
|
| 302 | this.UnknownFields = unknownFields.Build();
|
| 303 | }
|
| 304 | return this;
|
| 305 | }
|
| 306 | default: {
|
| 307 | if (pb::WireFormat.IsEndGroupTag(tag)) {
|
| 308 | if (unknownFields != null) {
|
| 309 | this.UnknownFields = unknownFields.Build();
|
| 310 | }
|
| 311 | return this;
|
| 312 | }
|
| 313 | if (unknownFields == null) {
|
| 314 | unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
| 315 | }
|
| 316 | ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
| 317 | break;
|
| 318 | }
|
| 319 | case 10: {
|
| 320 | Number = input.ReadString();
|
| 321 | break;
|
| 322 | }
|
| 323 | case 16: {
|
| 324 | int rawValue = input.ReadEnum();
|
| 325 | if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType), rawValue)) {
|
| 326 | if (unknownFields == null) {
|
| 327 | unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
| 328 | }
|
| 329 | unknownFields.MergeVarintField(2, (ulong) rawValue);
|
| 330 | } else {
|
| 331 | Type = (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType) rawValue;
|
| 332 | }
|
| 333 | break;
|
| 334 | }
|
| 335 | }
|
| 336 | }
|
| 337 | }
|
| 338 |
|
| 339 |
|
| 340 | public bool HasNumber {
|
| 341 | get { return result.HasNumber; }
|
| 342 | }
|
| 343 | public string Number {
|
| 344 | get { return result.Number; }
|
| 345 | set { SetNumber(value); }
|
| 346 | }
|
| 347 | public Builder SetNumber(string value) {
|
| 348 | pb::ThrowHelper.ThrowIfNull(value, "value");
|
| 349 | result.hasNumber = true;
|
| 350 | result.number_ = value;
|
| 351 | return this;
|
| 352 | }
|
| 353 | public Builder ClearNumber() {
|
| 354 | result.hasNumber = false;
|
| 355 | result.number_ = "";
|
| 356 | return this;
|
| 357 | }
|
| 358 |
|
| 359 | public bool HasType {
|
| 360 | get { return result.HasType; }
|
| 361 | }
|
| 362 | public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type {
|
| 363 | get { return result.Type; }
|
| 364 | set { SetType(value); }
|
| 365 | }
|
| 366 | public Builder SetType(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType value) {
|
| 367 | result.hasType = true;
|
| 368 | result.type_ = value;
|
| 369 | return this;
|
| 370 | }
|
| 371 | public Builder ClearType() {
|
| 372 | result.hasType = false;
|
| 373 | result.type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME;
|
| 374 | return this;
|
| 375 | }
|
| 376 | }
|
| 377 | static PhoneNumber() {
|
| 378 | object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null);
|
| 379 | }
|
| 380 | }
|
| 381 |
|
| 382 | }
|
| 383 | #endregion
|
| 384 |
|
| 385 | public const int NameFieldNumber = 1;
|
| 386 | private bool hasName;
|
| 387 | private string name_ = "";
|
| 388 | public bool HasName {
|
| 389 | get { return hasName; }
|
| 390 | }
|
| 391 | public string Name {
|
| 392 | get { return name_; }
|
| 393 | }
|
| 394 |
|
| 395 | public const int IdFieldNumber = 2;
|
| 396 | private bool hasId;
|
| 397 | private int id_ = 0;
|
| 398 | public bool HasId {
|
| 399 | get { return hasId; }
|
| 400 | }
|
| 401 | public int Id {
|
| 402 | get { return id_; }
|
| 403 | }
|
| 404 |
|
| 405 | public const int EmailFieldNumber = 3;
|
| 406 | private bool hasEmail;
|
| 407 | private string email_ = "";
|
| 408 | public bool HasEmail {
|
| 409 | get { return hasEmail; }
|
| 410 | }
|
| 411 | public string Email {
|
| 412 | get { return email_; }
|
| 413 | }
|
| 414 |
|
| 415 | public const int PhoneFieldNumber = 4;
|
| 416 | private pbc::PopsicleList<global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber> phone_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber>();
|
| 417 | public scg::IList<global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber> PhoneList {
|
| 418 | get { return phone_; }
|
| 419 | }
|
| 420 | public int PhoneCount {
|
| 421 | get { return phone_.Count; }
|
| 422 | }
|
| 423 | public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) {
|
| 424 | return phone_[index];
|
| 425 | }
|
| 426 |
|
| 427 | public override bool IsInitialized {
|
| 428 | get {
|
| 429 | if (!hasName) return false;
|
| 430 | if (!hasId) return false;
|
| 431 | foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) {
|
| 432 | if (!element.IsInitialized) return false;
|
| 433 | }
|
| 434 | return true;
|
| 435 | }
|
| 436 | }
|
| 437 |
|
| 438 | public override void WriteTo(pb::CodedOutputStream output) {
|
| 439 | int size = SerializedSize;
|
| 440 | if (HasName) {
|
| 441 | output.WriteString(1, Name);
|
| 442 | }
|
| 443 | if (HasId) {
|
| 444 | output.WriteInt32(2, Id);
|
| 445 | }
|
| 446 | if (HasEmail) {
|
| 447 | output.WriteString(3, Email);
|
| 448 | }
|
| 449 | foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) {
|
| 450 | output.WriteMessage(4, element);
|
| 451 | }
|
| 452 | UnknownFields.WriteTo(output);
|
| 453 | }
|
| 454 |
|
| 455 | private int memoizedSerializedSize = -1;
|
| 456 | public override int SerializedSize {
|
| 457 | get {
|
| 458 | int size = memoizedSerializedSize;
|
| 459 | if (size != -1) return size;
|
| 460 |
|
| 461 | size = 0;
|
| 462 | if (HasName) {
|
| 463 | size += pb::CodedOutputStream.ComputeStringSize(1, Name);
|
| 464 | }
|
| 465 | if (HasId) {
|
| 466 | size += pb::CodedOutputStream.ComputeInt32Size(2, Id);
|
| 467 | }
|
| 468 | if (HasEmail) {
|
| 469 | size += pb::CodedOutputStream.ComputeStringSize(3, Email);
|
| 470 | }
|
| 471 | foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) {
|
| 472 | size += pb::CodedOutputStream.ComputeMessageSize(4, element);
|
| 473 | }
|
| 474 | size += UnknownFields.SerializedSize;
|
| 475 | memoizedSerializedSize = size;
|
| 476 | return size;
|
| 477 | }
|
| 478 | }
|
| 479 |
|
| 480 | public static Person ParseFrom(pb::ByteString data) {
|
| 481 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 482 | }
|
| 483 | public static Person ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
| 484 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 485 | }
|
| 486 | public static Person ParseFrom(byte[] data) {
|
| 487 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 488 | }
|
| 489 | public static Person ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
| 490 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 491 | }
|
| 492 | public static Person ParseFrom(global::System.IO.Stream input) {
|
| 493 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 494 | }
|
| 495 | public static Person ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 496 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 497 | }
|
| 498 | public static Person ParseDelimitedFrom(global::System.IO.Stream input) {
|
| 499 | return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
| 500 | }
|
| 501 | public static Person ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 502 | return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
| 503 | }
|
| 504 | public static Person ParseFrom(pb::CodedInputStream input) {
|
| 505 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 506 | }
|
| 507 | public static Person ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 508 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 509 | }
|
| 510 | public static Builder CreateBuilder() { return new Builder(); }
|
| 511 | public override Builder ToBuilder() { return CreateBuilder(this); }
|
| 512 | public override Builder CreateBuilderForType() { return new Builder(); }
|
| 513 | public static Builder CreateBuilder(Person prototype) {
|
| 514 | return (Builder) new Builder().MergeFrom(prototype);
|
| 515 | }
|
| 516 |
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 517 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 518 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 519 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 520 | public sealed partial class Builder : pb::GeneratedBuilder<Person, Builder> {
|
| 521 | protected override Builder ThisBuilder {
|
| 522 | get { return this; }
|
| 523 | }
|
| 524 | public Builder() {}
|
| 525 |
|
| 526 | Person result = new Person();
|
| 527 |
|
| 528 | protected override Person MessageBeingBuilt {
|
| 529 | get { return result; }
|
| 530 | }
|
| 531 |
|
| 532 | public override Builder Clear() {
|
| 533 | result = new Person();
|
| 534 | return this;
|
| 535 | }
|
| 536 |
|
| 537 | public override Builder Clone() {
|
| 538 | return new Builder().MergeFrom(result);
|
| 539 | }
|
| 540 |
|
| 541 | public override pbd::MessageDescriptor DescriptorForType {
|
| 542 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Descriptor; }
|
| 543 | }
|
| 544 |
|
| 545 | public override Person DefaultInstanceForType {
|
| 546 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance; }
|
| 547 | }
|
| 548 |
|
| 549 | public override Person BuildPartial() {
|
| 550 | if (result == null) {
|
| 551 | throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
| 552 | }
|
| 553 | result.phone_.MakeReadOnly();
|
| 554 | Person returnMe = result;
|
| 555 | result = null;
|
| 556 | return returnMe;
|
| 557 | }
|
| 558 |
|
| 559 | public override Builder MergeFrom(pb::IMessage other) {
|
| 560 | if (other is Person) {
|
| 561 | return MergeFrom((Person) other);
|
| 562 | } else {
|
| 563 | base.MergeFrom(other);
|
| 564 | return this;
|
| 565 | }
|
| 566 | }
|
| 567 |
|
| 568 | public override Builder MergeFrom(Person other) {
|
| 569 | if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance) return this;
|
| 570 | if (other.HasName) {
|
| 571 | Name = other.Name;
|
| 572 | }
|
| 573 | if (other.HasId) {
|
| 574 | Id = other.Id;
|
| 575 | }
|
| 576 | if (other.HasEmail) {
|
| 577 | Email = other.Email;
|
| 578 | }
|
| 579 | if (other.phone_.Count != 0) {
|
| 580 | base.AddRange(other.phone_, result.phone_);
|
| 581 | }
|
| 582 | this.MergeUnknownFields(other.UnknownFields);
|
| 583 | return this;
|
| 584 | }
|
| 585 |
|
| 586 | public override Builder MergeFrom(pb::CodedInputStream input) {
|
| 587 | return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
| 588 | }
|
| 589 |
|
| 590 | public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 591 | pb::UnknownFieldSet.Builder unknownFields = null;
|
| 592 | while (true) {
|
| 593 | uint tag = input.ReadTag();
|
| 594 | switch (tag) {
|
| 595 | case 0: {
|
| 596 | if (unknownFields != null) {
|
| 597 | this.UnknownFields = unknownFields.Build();
|
| 598 | }
|
| 599 | return this;
|
| 600 | }
|
| 601 | default: {
|
| 602 | if (pb::WireFormat.IsEndGroupTag(tag)) {
|
| 603 | if (unknownFields != null) {
|
| 604 | this.UnknownFields = unknownFields.Build();
|
| 605 | }
|
| 606 | return this;
|
| 607 | }
|
| 608 | if (unknownFields == null) {
|
| 609 | unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
| 610 | }
|
| 611 | ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
| 612 | break;
|
| 613 | }
|
| 614 | case 10: {
|
| 615 | Name = input.ReadString();
|
| 616 | break;
|
| 617 | }
|
| 618 | case 16: {
|
| 619 | Id = input.ReadInt32();
|
| 620 | break;
|
| 621 | }
|
| 622 | case 26: {
|
| 623 | Email = input.ReadString();
|
| 624 | break;
|
| 625 | }
|
| 626 | case 34: {
|
| 627 | global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder subBuilder = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.CreateBuilder();
|
| 628 | input.ReadMessage(subBuilder, extensionRegistry);
|
| 629 | AddPhone(subBuilder.BuildPartial());
|
| 630 | break;
|
| 631 | }
|
| 632 | }
|
| 633 | }
|
| 634 | }
|
| 635 |
|
| 636 |
|
| 637 | public bool HasName {
|
| 638 | get { return result.HasName; }
|
| 639 | }
|
| 640 | public string Name {
|
| 641 | get { return result.Name; }
|
| 642 | set { SetName(value); }
|
| 643 | }
|
| 644 | public Builder SetName(string value) {
|
| 645 | pb::ThrowHelper.ThrowIfNull(value, "value");
|
| 646 | result.hasName = true;
|
| 647 | result.name_ = value;
|
| 648 | return this;
|
| 649 | }
|
| 650 | public Builder ClearName() {
|
| 651 | result.hasName = false;
|
| 652 | result.name_ = "";
|
| 653 | return this;
|
| 654 | }
|
| 655 |
|
| 656 | public bool HasId {
|
| 657 | get { return result.HasId; }
|
| 658 | }
|
| 659 | public int Id {
|
| 660 | get { return result.Id; }
|
| 661 | set { SetId(value); }
|
| 662 | }
|
| 663 | public Builder SetId(int value) {
|
| 664 | result.hasId = true;
|
| 665 | result.id_ = value;
|
| 666 | return this;
|
| 667 | }
|
| 668 | public Builder ClearId() {
|
| 669 | result.hasId = false;
|
| 670 | result.id_ = 0;
|
| 671 | return this;
|
| 672 | }
|
| 673 |
|
| 674 | public bool HasEmail {
|
| 675 | get { return result.HasEmail; }
|
| 676 | }
|
| 677 | public string Email {
|
| 678 | get { return result.Email; }
|
| 679 | set { SetEmail(value); }
|
| 680 | }
|
| 681 | public Builder SetEmail(string value) {
|
| 682 | pb::ThrowHelper.ThrowIfNull(value, "value");
|
| 683 | result.hasEmail = true;
|
| 684 | result.email_ = value;
|
| 685 | return this;
|
| 686 | }
|
| 687 | public Builder ClearEmail() {
|
| 688 | result.hasEmail = false;
|
| 689 | result.email_ = "";
|
| 690 | return this;
|
| 691 | }
|
| 692 |
|
| 693 | public pbc::IPopsicleList<global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber> PhoneList {
|
| 694 | get { return result.phone_; }
|
| 695 | }
|
| 696 | public int PhoneCount {
|
| 697 | get { return result.PhoneCount; }
|
| 698 | }
|
| 699 | public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) {
|
| 700 | return result.GetPhone(index);
|
| 701 | }
|
| 702 | public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) {
|
| 703 | pb::ThrowHelper.ThrowIfNull(value, "value");
|
| 704 | result.phone_[index] = value;
|
| 705 | return this;
|
| 706 | }
|
| 707 | public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) {
|
| 708 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
|
| 709 | result.phone_[index] = builderForValue.Build();
|
| 710 | return this;
|
| 711 | }
|
| 712 | public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) {
|
| 713 | pb::ThrowHelper.ThrowIfNull(value, "value");
|
| 714 | result.phone_.Add(value);
|
| 715 | return this;
|
| 716 | }
|
| 717 | public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) {
|
| 718 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
|
| 719 | result.phone_.Add(builderForValue.Build());
|
| 720 | return this;
|
| 721 | }
|
| 722 | public Builder AddRangePhone(scg::IEnumerable<global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber> values) {
|
| 723 | base.AddRange(values, result.phone_);
|
| 724 | return this;
|
| 725 | }
|
| 726 | public Builder ClearPhone() {
|
| 727 | result.phone_.Clear();
|
| 728 | return this;
|
| 729 | }
|
| 730 | }
|
| 731 | static Person() {
|
| 732 | object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null);
|
| 733 | }
|
| 734 | }
|
| 735 |
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 736 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 737 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 738 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 739 | public sealed partial class AddressBook : pb::GeneratedMessage<AddressBook, AddressBook.Builder> {
|
| 740 | private static readonly AddressBook defaultInstance = new Builder().BuildPartial();
|
| 741 | public static AddressBook DefaultInstance {
|
| 742 | get { return defaultInstance; }
|
| 743 | }
|
| 744 |
|
| 745 | public override AddressBook DefaultInstanceForType {
|
| 746 | get { return defaultInstance; }
|
| 747 | }
|
| 748 |
|
| 749 | protected override AddressBook ThisMessage {
|
| 750 | get { return this; }
|
| 751 | }
|
| 752 |
|
| 753 | public static pbd::MessageDescriptor Descriptor {
|
| 754 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_AddressBook__Descriptor; }
|
| 755 | }
|
| 756 |
|
| 757 | protected override pb::FieldAccess.FieldAccessorTable<AddressBook, AddressBook.Builder> InternalFieldAccessors {
|
| 758 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_AddressBook__FieldAccessorTable; }
|
| 759 | }
|
| 760 |
|
| 761 | public const int PersonFieldNumber = 1;
|
| 762 | private pbc::PopsicleList<global::Google.ProtocolBuffers.Examples.AddressBook.Person> person_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.Examples.AddressBook.Person>();
|
| 763 | public scg::IList<global::Google.ProtocolBuffers.Examples.AddressBook.Person> PersonList {
|
| 764 | get { return person_; }
|
| 765 | }
|
| 766 | public int PersonCount {
|
| 767 | get { return person_.Count; }
|
| 768 | }
|
| 769 | public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) {
|
| 770 | return person_[index];
|
| 771 | }
|
| 772 |
|
| 773 | public override bool IsInitialized {
|
| 774 | get {
|
| 775 | foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) {
|
| 776 | if (!element.IsInitialized) return false;
|
| 777 | }
|
| 778 | return true;
|
| 779 | }
|
| 780 | }
|
| 781 |
|
| 782 | public override void WriteTo(pb::CodedOutputStream output) {
|
| 783 | int size = SerializedSize;
|
| 784 | foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) {
|
| 785 | output.WriteMessage(1, element);
|
| 786 | }
|
| 787 | UnknownFields.WriteTo(output);
|
| 788 | }
|
| 789 |
|
| 790 | private int memoizedSerializedSize = -1;
|
| 791 | public override int SerializedSize {
|
| 792 | get {
|
| 793 | int size = memoizedSerializedSize;
|
| 794 | if (size != -1) return size;
|
| 795 |
|
| 796 | size = 0;
|
| 797 | foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) {
|
| 798 | size += pb::CodedOutputStream.ComputeMessageSize(1, element);
|
| 799 | }
|
| 800 | size += UnknownFields.SerializedSize;
|
| 801 | memoizedSerializedSize = size;
|
| 802 | return size;
|
| 803 | }
|
| 804 | }
|
| 805 |
|
| 806 | public static AddressBook ParseFrom(pb::ByteString data) {
|
| 807 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 808 | }
|
| 809 | public static AddressBook ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
| 810 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 811 | }
|
| 812 | public static AddressBook ParseFrom(byte[] data) {
|
| 813 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 814 | }
|
| 815 | public static AddressBook ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
| 816 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 817 | }
|
| 818 | public static AddressBook ParseFrom(global::System.IO.Stream input) {
|
| 819 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 820 | }
|
| 821 | public static AddressBook ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 822 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 823 | }
|
| 824 | public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input) {
|
| 825 | return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
| 826 | }
|
| 827 | public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 828 | return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
| 829 | }
|
| 830 | public static AddressBook ParseFrom(pb::CodedInputStream input) {
|
| 831 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 832 | }
|
| 833 | public static AddressBook ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 834 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 835 | }
|
| 836 | public static Builder CreateBuilder() { return new Builder(); }
|
| 837 | public override Builder ToBuilder() { return CreateBuilder(this); }
|
| 838 | public override Builder CreateBuilderForType() { return new Builder(); }
|
| 839 | public static Builder CreateBuilder(AddressBook prototype) {
|
| 840 | return (Builder) new Builder().MergeFrom(prototype);
|
| 841 | }
|
| 842 |
|
csharptest | 445bdce | 2011-05-20 15:50:54 -0500 | [diff] [blame^] | 843 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
| 844 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
| 845 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 846 | public sealed partial class Builder : pb::GeneratedBuilder<AddressBook, Builder> {
|
| 847 | protected override Builder ThisBuilder {
|
| 848 | get { return this; }
|
| 849 | }
|
| 850 | public Builder() {}
|
| 851 |
|
| 852 | AddressBook result = new AddressBook();
|
| 853 |
|
| 854 | protected override AddressBook MessageBeingBuilt {
|
| 855 | get { return result; }
|
| 856 | }
|
| 857 |
|
| 858 | public override Builder Clear() {
|
| 859 | result = new AddressBook();
|
| 860 | return this;
|
| 861 | }
|
| 862 |
|
| 863 | public override Builder Clone() {
|
| 864 | return new Builder().MergeFrom(result);
|
| 865 | }
|
| 866 |
|
| 867 | public override pbd::MessageDescriptor DescriptorForType {
|
| 868 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.Descriptor; }
|
| 869 | }
|
| 870 |
|
| 871 | public override AddressBook DefaultInstanceForType {
|
| 872 | get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance; }
|
| 873 | }
|
| 874 |
|
| 875 | public override AddressBook BuildPartial() {
|
| 876 | if (result == null) {
|
| 877 | throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
| 878 | }
|
| 879 | result.person_.MakeReadOnly();
|
| 880 | AddressBook returnMe = result;
|
| 881 | result = null;
|
| 882 | return returnMe;
|
| 883 | }
|
| 884 |
|
| 885 | public override Builder MergeFrom(pb::IMessage other) {
|
| 886 | if (other is AddressBook) {
|
| 887 | return MergeFrom((AddressBook) other);
|
| 888 | } else {
|
| 889 | base.MergeFrom(other);
|
| 890 | return this;
|
| 891 | }
|
| 892 | }
|
| 893 |
|
| 894 | public override Builder MergeFrom(AddressBook other) {
|
| 895 | if (other == global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance) return this;
|
| 896 | if (other.person_.Count != 0) {
|
| 897 | base.AddRange(other.person_, result.person_);
|
| 898 | }
|
| 899 | this.MergeUnknownFields(other.UnknownFields);
|
| 900 | return this;
|
| 901 | }
|
| 902 |
|
| 903 | public override Builder MergeFrom(pb::CodedInputStream input) {
|
| 904 | return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
| 905 | }
|
| 906 |
|
| 907 | public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 908 | pb::UnknownFieldSet.Builder unknownFields = null;
|
| 909 | while (true) {
|
| 910 | uint tag = input.ReadTag();
|
| 911 | switch (tag) {
|
| 912 | case 0: {
|
| 913 | if (unknownFields != null) {
|
| 914 | this.UnknownFields = unknownFields.Build();
|
| 915 | }
|
| 916 | return this;
|
| 917 | }
|
| 918 | default: {
|
| 919 | if (pb::WireFormat.IsEndGroupTag(tag)) {
|
| 920 | if (unknownFields != null) {
|
| 921 | this.UnknownFields = unknownFields.Build();
|
| 922 | }
|
| 923 | return this;
|
| 924 | }
|
| 925 | if (unknownFields == null) {
|
| 926 | unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
| 927 | }
|
| 928 | ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
| 929 | break;
|
| 930 | }
|
| 931 | case 10: {
|
| 932 | global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder subBuilder = global::Google.ProtocolBuffers.Examples.AddressBook.Person.CreateBuilder();
|
| 933 | input.ReadMessage(subBuilder, extensionRegistry);
|
| 934 | AddPerson(subBuilder.BuildPartial());
|
| 935 | break;
|
| 936 | }
|
| 937 | }
|
| 938 | }
|
| 939 | }
|
| 940 |
|
| 941 |
|
| 942 | public pbc::IPopsicleList<global::Google.ProtocolBuffers.Examples.AddressBook.Person> PersonList {
|
| 943 | get { return result.person_; }
|
| 944 | }
|
| 945 | public int PersonCount {
|
| 946 | get { return result.PersonCount; }
|
| 947 | }
|
| 948 | public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) {
|
| 949 | return result.GetPerson(index);
|
| 950 | }
|
| 951 | public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person value) {
|
| 952 | pb::ThrowHelper.ThrowIfNull(value, "value");
|
| 953 | result.person_[index] = value;
|
| 954 | return this;
|
| 955 | }
|
| 956 | public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) {
|
| 957 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
|
| 958 | result.person_[index] = builderForValue.Build();
|
| 959 | return this;
|
| 960 | }
|
| 961 | public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person value) {
|
| 962 | pb::ThrowHelper.ThrowIfNull(value, "value");
|
| 963 | result.person_.Add(value);
|
| 964 | return this;
|
| 965 | }
|
| 966 | public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) {
|
| 967 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
|
| 968 | result.person_.Add(builderForValue.Build());
|
| 969 | return this;
|
| 970 | }
|
| 971 | public Builder AddRangePerson(scg::IEnumerable<global::Google.ProtocolBuffers.Examples.AddressBook.Person> values) {
|
| 972 | base.AddRange(values, result.person_);
|
| 973 | return this;
|
| 974 | }
|
| 975 | public Builder ClearPerson() {
|
| 976 | result.person_.Clear();
|
| 977 | return this;
|
| 978 | }
|
| 979 | }
|
| 980 | static AddressBook() {
|
| 981 | object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null);
|
| 982 | }
|
| 983 | }
|
| 984 |
|
| 985 | #endregion
|
| 986 |
|
| 987 | }
|