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