1 // <auto-generated> 2 // Generated by the protocol buffer compiler. DO NOT EDIT! 3 // source: addressbook.proto 4 // </auto-generated> 5 #pragma warning disable 1591, 0612, 3021 6 #region Designer generated code 7 8 using pb = global::Google.Protobuf; 9 using pbc = global::Google.Protobuf.Collections; 10 using pbr = global::Google.Protobuf.Reflection; 11 using scg = global::System.Collections.Generic; 12 namespace Google.Protobuf.Examples.AddressBook { 13 14 /// <summary>Holder for reflection information generated from addressbook.proto</summary> 15 public static partial class AddressbookReflection { 16 17 #region Descriptor 18 /// <summary>File descriptor for addressbook.proto</summary> 19 public static pbr::FileDescriptor Descriptor { 20 get { return descriptor; } 21 } 22 private static pbr::FileDescriptor descriptor; 23 AddressbookReflection()24 static AddressbookReflection() { 25 byte[] descriptorData = global::System.Convert.FromBase64String( 26 string.Concat( 27 "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaH2dvb2dsZS9wcm90b2J1", 28 "Zi90aW1lc3RhbXAucHJvdG8ihwIKBlBlcnNvbhIMCgRuYW1lGAEgASgJEgoK", 29 "AmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25lcxgEIAMoCzIcLnR1", 30 "dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchIwCgxsYXN0X3VwZGF0ZWQYBSAB", 31 "KAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wGkcKC1Bob25lTnVtYmVy", 32 "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy", 33 "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N", 34 "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy", 35 "EC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3JpYWxCEUFk", 36 "ZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1wbGVzLkFk", 37 "ZHJlc3NCb29rYgZwcm90bzM=")); 38 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 39 new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, }, 40 new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { 41 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person), global::Google.Protobuf.Examples.AddressBook.Person.Parser, new[]{ "Name", "Id", "Email", "Phones", "LastUpdated" }, null, new[]{ typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser, new[]{ "Number", "Type" }, null, null, null, null)}), 42 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.AddressBook.Parser, new[]{ "People" }, null, null, null, null) 43 })); 44 } 45 #endregion 46 47 } 48 #region Messages 49 /// <summary> 50 /// [START messages] 51 /// </summary> 52 public sealed partial class Person : pb::IMessage<Person> 53 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 54 , pb::IBufferMessage 55 #endif 56 { 57 private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person()); 58 private pb::UnknownFieldSet _unknownFields; 59 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 60 public static pb::MessageParser<Person> Parser { get { return _parser; } } 61 62 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 63 public static pbr::MessageDescriptor Descriptor { 64 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; } 65 } 66 67 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 68 pbr::MessageDescriptor pb::IMessage.Descriptor { 69 get { return Descriptor; } 70 } 71 72 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Person()73 public Person() { 74 OnConstruction(); 75 } 76 OnConstruction()77 partial void OnConstruction(); 78 79 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Person(Person other)80 public Person(Person other) : this() { 81 name_ = other.name_; 82 id_ = other.id_; 83 email_ = other.email_; 84 phones_ = other.phones_.Clone(); 85 lastUpdated_ = other.lastUpdated_ != null ? other.lastUpdated_.Clone() : null; 86 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 87 } 88 89 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()90 public Person Clone() { 91 return new Person(this); 92 } 93 94 /// <summary>Field number for the "name" field.</summary> 95 public const int NameFieldNumber = 1; 96 private string name_ = ""; 97 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 98 public string Name { 99 get { return name_; } 100 set { 101 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 102 } 103 } 104 105 /// <summary>Field number for the "id" field.</summary> 106 public const int IdFieldNumber = 2; 107 private int id_; 108 /// <summary> 109 /// Unique ID number for this person. 110 /// </summary> 111 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 112 public int Id { 113 get { return id_; } 114 set { 115 id_ = value; 116 } 117 } 118 119 /// <summary>Field number for the "email" field.</summary> 120 public const int EmailFieldNumber = 3; 121 private string email_ = ""; 122 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 123 public string Email { 124 get { return email_; } 125 set { 126 email_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 127 } 128 } 129 130 /// <summary>Field number for the "phones" field.</summary> 131 public const int PhonesFieldNumber = 4; 132 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> _repeated_phones_codec 133 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); 134 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> phones_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber>(); 135 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 136 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> Phones { 137 get { return phones_; } 138 } 139 140 /// <summary>Field number for the "last_updated" field.</summary> 141 public const int LastUpdatedFieldNumber = 5; 142 private global::Google.Protobuf.WellKnownTypes.Timestamp lastUpdated_; 143 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 144 public global::Google.Protobuf.WellKnownTypes.Timestamp LastUpdated { 145 get { return lastUpdated_; } 146 set { 147 lastUpdated_ = value; 148 } 149 } 150 151 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)152 public override bool Equals(object other) { 153 return Equals(other as Person); 154 } 155 156 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(Person other)157 public bool Equals(Person other) { 158 if (ReferenceEquals(other, null)) { 159 return false; 160 } 161 if (ReferenceEquals(other, this)) { 162 return true; 163 } 164 if (Name != other.Name) return false; 165 if (Id != other.Id) return false; 166 if (Email != other.Email) return false; 167 if(!phones_.Equals(other.phones_)) return false; 168 if (!object.Equals(LastUpdated, other.LastUpdated)) return false; 169 return Equals(_unknownFields, other._unknownFields); 170 } 171 172 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()173 public override int GetHashCode() { 174 int hash = 1; 175 if (Name.Length != 0) hash ^= Name.GetHashCode(); 176 if (Id != 0) hash ^= Id.GetHashCode(); 177 if (Email.Length != 0) hash ^= Email.GetHashCode(); 178 hash ^= phones_.GetHashCode(); 179 if (lastUpdated_ != null) hash ^= LastUpdated.GetHashCode(); 180 if (_unknownFields != null) { 181 hash ^= _unknownFields.GetHashCode(); 182 } 183 return hash; 184 } 185 186 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()187 public override string ToString() { 188 return pb::JsonFormatter.ToDiagnosticString(this); 189 } 190 191 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)192 public void WriteTo(pb::CodedOutputStream output) { 193 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 194 output.WriteRawMessage(this); 195 #else 196 if (Name.Length != 0) { 197 output.WriteRawTag(10); 198 output.WriteString(Name); 199 } 200 if (Id != 0) { 201 output.WriteRawTag(16); 202 output.WriteInt32(Id); 203 } 204 if (Email.Length != 0) { 205 output.WriteRawTag(26); 206 output.WriteString(Email); 207 } 208 phones_.WriteTo(output, _repeated_phones_codec); 209 if (lastUpdated_ != null) { 210 output.WriteRawTag(42); 211 output.WriteMessage(LastUpdated); 212 } 213 if (_unknownFields != null) { 214 _unknownFields.WriteTo(output); 215 } 216 #endif 217 } 218 219 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 220 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)221 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 222 if (Name.Length != 0) { 223 output.WriteRawTag(10); 224 output.WriteString(Name); 225 } 226 if (Id != 0) { 227 output.WriteRawTag(16); 228 output.WriteInt32(Id); 229 } 230 if (Email.Length != 0) { 231 output.WriteRawTag(26); 232 output.WriteString(Email); 233 } 234 phones_.WriteTo(ref output, _repeated_phones_codec); 235 if (lastUpdated_ != null) { 236 output.WriteRawTag(42); 237 output.WriteMessage(LastUpdated); 238 } 239 if (_unknownFields != null) { 240 _unknownFields.WriteTo(ref output); 241 } 242 } 243 #endif 244 245 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()246 public int CalculateSize() { 247 int size = 0; 248 if (Name.Length != 0) { 249 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); 250 } 251 if (Id != 0) { 252 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); 253 } 254 if (Email.Length != 0) { 255 size += 1 + pb::CodedOutputStream.ComputeStringSize(Email); 256 } 257 size += phones_.CalculateSize(_repeated_phones_codec); 258 if (lastUpdated_ != null) { 259 size += 1 + pb::CodedOutputStream.ComputeMessageSize(LastUpdated); 260 } 261 if (_unknownFields != null) { 262 size += _unknownFields.CalculateSize(); 263 } 264 return size; 265 } 266 267 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(Person other)268 public void MergeFrom(Person other) { 269 if (other == null) { 270 return; 271 } 272 if (other.Name.Length != 0) { 273 Name = other.Name; 274 } 275 if (other.Id != 0) { 276 Id = other.Id; 277 } 278 if (other.Email.Length != 0) { 279 Email = other.Email; 280 } 281 phones_.Add(other.phones_); 282 if (other.lastUpdated_ != null) { 283 if (lastUpdated_ == null) { 284 LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); 285 } 286 LastUpdated.MergeFrom(other.LastUpdated); 287 } 288 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 289 } 290 291 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)292 public void MergeFrom(pb::CodedInputStream input) { 293 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 294 input.ReadRawMessage(this); 295 #else 296 uint tag; 297 while ((tag = input.ReadTag()) != 0) { 298 switch(tag) { 299 default: 300 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 301 break; 302 case 10: { 303 Name = input.ReadString(); 304 break; 305 } 306 case 16: { 307 Id = input.ReadInt32(); 308 break; 309 } 310 case 26: { 311 Email = input.ReadString(); 312 break; 313 } 314 case 34: { 315 phones_.AddEntriesFrom(input, _repeated_phones_codec); 316 break; 317 } 318 case 42: { 319 if (lastUpdated_ == null) { 320 LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); 321 } 322 input.ReadMessage(LastUpdated); 323 break; 324 } 325 } 326 } 327 #endif 328 } 329 330 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 331 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)332 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 333 uint tag; 334 while ((tag = input.ReadTag()) != 0) { 335 switch(tag) { 336 default: 337 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 338 break; 339 case 10: { 340 Name = input.ReadString(); 341 break; 342 } 343 case 16: { 344 Id = input.ReadInt32(); 345 break; 346 } 347 case 26: { 348 Email = input.ReadString(); 349 break; 350 } 351 case 34: { 352 phones_.AddEntriesFrom(ref input, _repeated_phones_codec); 353 break; 354 } 355 case 42: { 356 if (lastUpdated_ == null) { 357 LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); 358 } 359 input.ReadMessage(LastUpdated); 360 break; 361 } 362 } 363 } 364 } 365 #endif 366 367 #region Nested types 368 /// <summary>Container for nested types declared in the Person message type.</summary> 369 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 370 public static partial class Types { 371 public enum PhoneType { 372 [pbr::OriginalName("MOBILE")] Mobile = 0, 373 [pbr::OriginalName("HOME")] Home = 1, 374 [pbr::OriginalName("WORK")] Work = 2, 375 } 376 377 public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber> 378 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 379 , pb::IBufferMessage 380 #endif 381 { 382 private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber()); 383 private pb::UnknownFieldSet _unknownFields; 384 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 385 public static pb::MessageParser<PhoneNumber> Parser { get { return _parser; } } 386 387 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 388 public static pbr::MessageDescriptor Descriptor { 389 get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } 390 } 391 392 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 393 pbr::MessageDescriptor pb::IMessage.Descriptor { 394 get { return Descriptor; } 395 } 396 397 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] PhoneNumber()398 public PhoneNumber() { 399 OnConstruction(); 400 } 401 OnConstruction()402 partial void OnConstruction(); 403 404 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] PhoneNumber(PhoneNumber other)405 public PhoneNumber(PhoneNumber other) : this() { 406 number_ = other.number_; 407 type_ = other.type_; 408 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 409 } 410 411 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()412 public PhoneNumber Clone() { 413 return new PhoneNumber(this); 414 } 415 416 /// <summary>Field number for the "number" field.</summary> 417 public const int NumberFieldNumber = 1; 418 private string number_ = ""; 419 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 420 public string Number { 421 get { return number_; } 422 set { 423 number_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 424 } 425 } 426 427 /// <summary>Field number for the "type" field.</summary> 428 public const int TypeFieldNumber = 2; 429 private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile; 430 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 431 public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { 432 get { return type_; } 433 set { 434 type_ = value; 435 } 436 } 437 438 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)439 public override bool Equals(object other) { 440 return Equals(other as PhoneNumber); 441 } 442 443 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(PhoneNumber other)444 public bool Equals(PhoneNumber other) { 445 if (ReferenceEquals(other, null)) { 446 return false; 447 } 448 if (ReferenceEquals(other, this)) { 449 return true; 450 } 451 if (Number != other.Number) return false; 452 if (Type != other.Type) return false; 453 return Equals(_unknownFields, other._unknownFields); 454 } 455 456 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()457 public override int GetHashCode() { 458 int hash = 1; 459 if (Number.Length != 0) hash ^= Number.GetHashCode(); 460 if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) hash ^= Type.GetHashCode(); 461 if (_unknownFields != null) { 462 hash ^= _unknownFields.GetHashCode(); 463 } 464 return hash; 465 } 466 467 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()468 public override string ToString() { 469 return pb::JsonFormatter.ToDiagnosticString(this); 470 } 471 472 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)473 public void WriteTo(pb::CodedOutputStream output) { 474 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 475 output.WriteRawMessage(this); 476 #else 477 if (Number.Length != 0) { 478 output.WriteRawTag(10); 479 output.WriteString(Number); 480 } 481 if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { 482 output.WriteRawTag(16); 483 output.WriteEnum((int) Type); 484 } 485 if (_unknownFields != null) { 486 _unknownFields.WriteTo(output); 487 } 488 #endif 489 } 490 491 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 492 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)493 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 494 if (Number.Length != 0) { 495 output.WriteRawTag(10); 496 output.WriteString(Number); 497 } 498 if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { 499 output.WriteRawTag(16); 500 output.WriteEnum((int) Type); 501 } 502 if (_unknownFields != null) { 503 _unknownFields.WriteTo(ref output); 504 } 505 } 506 #endif 507 508 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()509 public int CalculateSize() { 510 int size = 0; 511 if (Number.Length != 0) { 512 size += 1 + pb::CodedOutputStream.ComputeStringSize(Number); 513 } 514 if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { 515 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); 516 } 517 if (_unknownFields != null) { 518 size += _unknownFields.CalculateSize(); 519 } 520 return size; 521 } 522 523 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(PhoneNumber other)524 public void MergeFrom(PhoneNumber other) { 525 if (other == null) { 526 return; 527 } 528 if (other.Number.Length != 0) { 529 Number = other.Number; 530 } 531 if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { 532 Type = other.Type; 533 } 534 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 535 } 536 537 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)538 public void MergeFrom(pb::CodedInputStream input) { 539 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 540 input.ReadRawMessage(this); 541 #else 542 uint tag; 543 while ((tag = input.ReadTag()) != 0) { 544 switch(tag) { 545 default: 546 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 547 break; 548 case 10: { 549 Number = input.ReadString(); 550 break; 551 } 552 case 16: { 553 Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum(); 554 break; 555 } 556 } 557 } 558 #endif 559 } 560 561 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 562 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)563 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 564 uint tag; 565 while ((tag = input.ReadTag()) != 0) { 566 switch(tag) { 567 default: 568 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 569 break; 570 case 10: { 571 Number = input.ReadString(); 572 break; 573 } 574 case 16: { 575 Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum(); 576 break; 577 } 578 } 579 } 580 } 581 #endif 582 583 } 584 585 } 586 #endregion 587 588 } 589 590 /// <summary> 591 /// Our address book file is just one of these. 592 /// </summary> 593 public sealed partial class AddressBook : pb::IMessage<AddressBook> 594 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 595 , pb::IBufferMessage 596 #endif 597 { 598 private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook()); 599 private pb::UnknownFieldSet _unknownFields; 600 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 601 public static pb::MessageParser<AddressBook> Parser { get { return _parser; } } 602 603 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 604 public static pbr::MessageDescriptor Descriptor { 605 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; } 606 } 607 608 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 609 pbr::MessageDescriptor pb::IMessage.Descriptor { 610 get { return Descriptor; } 611 } 612 613 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] AddressBook()614 public AddressBook() { 615 OnConstruction(); 616 } 617 OnConstruction()618 partial void OnConstruction(); 619 620 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] AddressBook(AddressBook other)621 public AddressBook(AddressBook other) : this() { 622 people_ = other.people_.Clone(); 623 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 624 } 625 626 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()627 public AddressBook Clone() { 628 return new AddressBook(this); 629 } 630 631 /// <summary>Field number for the "people" field.</summary> 632 public const int PeopleFieldNumber = 1; 633 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person> _repeated_people_codec 634 = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); 635 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> people_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person>(); 636 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 637 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> People { 638 get { return people_; } 639 } 640 641 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)642 public override bool Equals(object other) { 643 return Equals(other as AddressBook); 644 } 645 646 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(AddressBook other)647 public bool Equals(AddressBook other) { 648 if (ReferenceEquals(other, null)) { 649 return false; 650 } 651 if (ReferenceEquals(other, this)) { 652 return true; 653 } 654 if(!people_.Equals(other.people_)) return false; 655 return Equals(_unknownFields, other._unknownFields); 656 } 657 658 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()659 public override int GetHashCode() { 660 int hash = 1; 661 hash ^= people_.GetHashCode(); 662 if (_unknownFields != null) { 663 hash ^= _unknownFields.GetHashCode(); 664 } 665 return hash; 666 } 667 668 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()669 public override string ToString() { 670 return pb::JsonFormatter.ToDiagnosticString(this); 671 } 672 673 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)674 public void WriteTo(pb::CodedOutputStream output) { 675 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 676 output.WriteRawMessage(this); 677 #else 678 people_.WriteTo(output, _repeated_people_codec); 679 if (_unknownFields != null) { 680 _unknownFields.WriteTo(output); 681 } 682 #endif 683 } 684 685 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 686 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)687 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 688 people_.WriteTo(ref output, _repeated_people_codec); 689 if (_unknownFields != null) { 690 _unknownFields.WriteTo(ref output); 691 } 692 } 693 #endif 694 695 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()696 public int CalculateSize() { 697 int size = 0; 698 size += people_.CalculateSize(_repeated_people_codec); 699 if (_unknownFields != null) { 700 size += _unknownFields.CalculateSize(); 701 } 702 return size; 703 } 704 705 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(AddressBook other)706 public void MergeFrom(AddressBook other) { 707 if (other == null) { 708 return; 709 } 710 people_.Add(other.people_); 711 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 712 } 713 714 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)715 public void MergeFrom(pb::CodedInputStream input) { 716 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 717 input.ReadRawMessage(this); 718 #else 719 uint tag; 720 while ((tag = input.ReadTag()) != 0) { 721 switch(tag) { 722 default: 723 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 724 break; 725 case 10: { 726 people_.AddEntriesFrom(input, _repeated_people_codec); 727 break; 728 } 729 } 730 } 731 #endif 732 } 733 734 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 735 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)736 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 737 uint tag; 738 while ((tag = input.ReadTag()) != 0) { 739 switch(tag) { 740 default: 741 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 742 break; 743 case 10: { 744 people_.AddEntriesFrom(ref input, _repeated_people_codec); 745 break; 746 } 747 } 748 } 749 } 750 #endif 751 752 } 753 754 #endregion 755 756 } 757 758 #endregion Designer generated code 759