@@ -49,7 +49,11 @@ static AddressbookReflection() {
49
49
/// <summary>
50
50
/// [START messages]
51
51
/// </summary>
52
- public sealed partial class Person : pb ::IMessage < Person > , pb ::IBufferMessage {
52
+ public sealed partial class Person : pb ::IMessage < Person >
53
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
54
+ , pb ::IBufferMessage
55
+ #endif
56
+ {
53
57
private static readonly pb ::MessageParser < Person > _parser = new pb ::MessageParser < Person > ( ( ) => new Person ( ) ) ;
54
58
private pb ::UnknownFieldSet _unknownFields ;
55
59
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
@@ -256,9 +260,44 @@ public void MergeFrom(Person other) {
256
260
257
261
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
258
262
public void MergeFrom ( pb ::CodedInputStream input ) {
263
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
259
264
input . ReadRawMessage ( this ) ;
265
+ #else
266
+ uint tag ;
267
+ while ( ( tag = input . ReadTag ( ) ) != 0 ) {
268
+ switch ( tag ) {
269
+ default :
270
+ _unknownFields = pb ::UnknownFieldSet . MergeFieldFrom ( _unknownFields , input ) ;
271
+ break ;
272
+ case 10 : {
273
+ Name = input . ReadString ( ) ;
274
+ break ;
275
+ }
276
+ case 16 : {
277
+ Id = input . ReadInt32 ( ) ;
278
+ break ;
279
+ }
280
+ case 26 : {
281
+ Email = input . ReadString ( ) ;
282
+ break ;
283
+ }
284
+ case 34 : {
285
+ phones_ . AddEntriesFrom ( input , _repeated_phones_codec ) ;
286
+ break ;
287
+ }
288
+ case 42 : {
289
+ if ( lastUpdated_ == null ) {
290
+ LastUpdated = new global ::Google . Protobuf . WellKnownTypes . Timestamp ( ) ;
291
+ }
292
+ input . ReadMessage ( LastUpdated ) ;
293
+ break ;
294
+ }
295
+ }
296
+ }
297
+ #endif
260
298
}
261
299
300
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
262
301
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
263
302
void pb ::IBufferMessage . InternalMergeFrom ( ref pb ::ParseContext input ) {
264
303
uint tag ;
@@ -293,6 +332,7 @@ public void MergeFrom(pb::CodedInputStream input) {
293
332
}
294
333
}
295
334
}
335
+ #endif
296
336
297
337
#region Nested types
298
338
/// <summary>Container for nested types declared in the Person message type.</summary>
@@ -304,7 +344,11 @@ public enum PhoneType {
304
344
[ pbr ::OriginalName ( "WORK" ) ] Work = 2 ,
305
345
}
306
346
307
- public sealed partial class PhoneNumber : pb ::IMessage < PhoneNumber > , pb ::IBufferMessage {
347
+ public sealed partial class PhoneNumber : pb ::IMessage < PhoneNumber >
348
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
349
+ , pb ::IBufferMessage
350
+ #endif
351
+ {
308
352
private static readonly pb ::MessageParser < PhoneNumber > _parser = new pb ::MessageParser < PhoneNumber > ( ( ) => new PhoneNumber ( ) ) ;
309
353
private pb ::UnknownFieldSet _unknownFields ;
310
354
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
@@ -441,9 +485,29 @@ public void MergeFrom(PhoneNumber other) {
441
485
442
486
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
443
487
public void MergeFrom ( pb ::CodedInputStream input ) {
488
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
444
489
input . ReadRawMessage ( this ) ;
490
+ #else
491
+ uint tag ;
492
+ while ( ( tag = input . ReadTag ( ) ) != 0 ) {
493
+ switch ( tag ) {
494
+ default :
495
+ _unknownFields = pb ::UnknownFieldSet . MergeFieldFrom ( _unknownFields , input ) ;
496
+ break ;
497
+ case 10 : {
498
+ Number = input . ReadString ( ) ;
499
+ break ;
500
+ }
501
+ case 16 : {
502
+ Type = ( global ::Google . Protobuf . Examples . AddressBook . Person . Types . PhoneType ) input . ReadEnum ( ) ;
503
+ break ;
504
+ }
505
+ }
506
+ }
507
+ #endif
445
508
}
446
509
510
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
447
511
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
448
512
void pb ::IBufferMessage . InternalMergeFrom ( ref pb ::ParseContext input ) {
449
513
uint tag ;
@@ -463,6 +527,7 @@ public void MergeFrom(pb::CodedInputStream input) {
463
527
}
464
528
}
465
529
}
530
+ #endif
466
531
467
532
}
468
533
@@ -474,7 +539,11 @@ public void MergeFrom(pb::CodedInputStream input) {
474
539
/// <summary>
475
540
/// Our address book file is just one of these.
476
541
/// </summary>
477
- public sealed partial class AddressBook : pb ::IMessage < AddressBook > , pb ::IBufferMessage {
542
+ public sealed partial class AddressBook : pb ::IMessage < AddressBook >
543
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
544
+ , pb ::IBufferMessage
545
+ #endif
546
+ {
478
547
private static readonly pb ::MessageParser < AddressBook > _parser = new pb ::MessageParser < AddressBook > ( ( ) => new AddressBook ( ) ) ;
479
548
private pb ::UnknownFieldSet _unknownFields ;
480
549
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
@@ -579,9 +648,25 @@ public void MergeFrom(AddressBook other) {
579
648
580
649
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
581
650
public void MergeFrom ( pb ::CodedInputStream input ) {
651
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
582
652
input . ReadRawMessage ( this ) ;
653
+ #else
654
+ uint tag ;
655
+ while ( ( tag = input . ReadTag ( ) ) != 0 ) {
656
+ switch ( tag ) {
657
+ default :
658
+ _unknownFields = pb ::UnknownFieldSet . MergeFieldFrom ( _unknownFields , input ) ;
659
+ break ;
660
+ case 10 : {
661
+ people_ . AddEntriesFrom ( input , _repeated_people_codec ) ;
662
+ break ;
663
+ }
664
+ }
665
+ }
666
+ #endif
583
667
}
584
668
669
+ #if ! GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
585
670
[ global ::System . Diagnostics . DebuggerNonUserCodeAttribute ]
586
671
void pb ::IBufferMessage . InternalMergeFrom ( ref pb ::ParseContext input ) {
587
672
uint tag ;
@@ -597,6 +682,7 @@ public void MergeFrom(pb::CodedInputStream input) {
597
682
}
598
683
}
599
684
}
685
+ #endif
600
686
601
687
}
602
688
0 commit comments