From c53484539c691a717ad531081e6fbed7fd4ea192 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Fri, 1 Jul 2016 13:19:19 +0100 Subject: Changes to generated code from previous commit --- csharp/src/AddressBook/Addressbook.cs | 55 +++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 5 deletions(-) (limited to 'csharp/src/AddressBook/Addressbook.cs') diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index 362e1cb6..8e691ad4 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Google.Protobuf.Examples.AddressBook { /// Holder for reflection information generated from addressbook.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class AddressbookReflection { #region Descriptor @@ -46,25 +45,29 @@ namespace Google.Protobuf.Examples.AddressBook { /// /// [START messages] /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Person : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Person()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Person() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Person(Person other) : this() { name_ = other.name_; id_ = other.id_; @@ -72,6 +75,7 @@ namespace Google.Protobuf.Examples.AddressBook { phones_ = other.phones_.Clone(); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Person Clone() { return new Person(this); } @@ -79,6 +83,7 @@ namespace Google.Protobuf.Examples.AddressBook { /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { get { return name_; } set { @@ -92,6 +97,7 @@ namespace Google.Protobuf.Examples.AddressBook { /// /// Unique ID number for this person. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Id { get { return id_; } set { @@ -102,6 +108,7 @@ namespace Google.Protobuf.Examples.AddressBook { /// Field number for the "email" field. public const int EmailFieldNumber = 3; private string email_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Email { get { return email_; } set { @@ -114,14 +121,17 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::FieldCodec _repeated_phones_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); private readonly pbc::RepeatedField phones_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Phones { get { return phones_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Person); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Person other) { if (ReferenceEquals(other, null)) { return false; @@ -136,6 +146,7 @@ namespace Google.Protobuf.Examples.AddressBook { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -145,10 +156,12 @@ namespace Google.Protobuf.Examples.AddressBook { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -165,6 +178,7 @@ namespace Google.Protobuf.Examples.AddressBook { phones_.WriteTo(output, _repeated_phones_codec); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -180,6 +194,7 @@ namespace Google.Protobuf.Examples.AddressBook { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Person other) { if (other == null) { return; @@ -196,6 +211,7 @@ namespace Google.Protobuf.Examples.AddressBook { phones_.Add(other.phones_); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -225,7 +241,7 @@ namespace Google.Protobuf.Examples.AddressBook { #region Nested types /// Container for nested types declared in the Person message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { public enum PhoneType { [pbr::OriginalName("MOBILE")] Mobile = 0, @@ -233,30 +249,35 @@ namespace Google.Protobuf.Examples.AddressBook { [pbr::OriginalName("WORK")] Work = 2, } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class PhoneNumber : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhoneNumber()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PhoneNumber() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PhoneNumber(PhoneNumber other) : this() { number_ = other.number_; type_ = other.type_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PhoneNumber Clone() { return new PhoneNumber(this); } @@ -264,6 +285,7 @@ namespace Google.Protobuf.Examples.AddressBook { /// Field number for the "number" field. public const int NumberFieldNumber = 1; private string number_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Number { get { return number_; } set { @@ -274,6 +296,7 @@ namespace Google.Protobuf.Examples.AddressBook { /// Field number for the "type" field. public const int TypeFieldNumber = 2; private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { get { return type_; } set { @@ -281,10 +304,12 @@ namespace Google.Protobuf.Examples.AddressBook { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as PhoneNumber); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(PhoneNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -297,6 +322,7 @@ namespace Google.Protobuf.Examples.AddressBook { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Number.Length != 0) hash ^= Number.GetHashCode(); @@ -304,10 +330,12 @@ namespace Google.Protobuf.Examples.AddressBook { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Number.Length != 0) { output.WriteRawTag(10); @@ -319,6 +347,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Number.Length != 0) { @@ -330,6 +359,7 @@ namespace Google.Protobuf.Examples.AddressBook { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(PhoneNumber other) { if (other == null) { return; @@ -342,6 +372,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -371,29 +402,34 @@ namespace Google.Protobuf.Examples.AddressBook { /// /// Our address book file is just one of these. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class AddressBook : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressBook()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public AddressBook() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public AddressBook(AddressBook other) : this() { people_ = other.people_.Clone(); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public AddressBook Clone() { return new AddressBook(this); } @@ -403,14 +439,17 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::FieldCodec _repeated_people_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); private readonly pbc::RepeatedField people_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField People { get { return people_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as AddressBook); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(AddressBook other) { if (ReferenceEquals(other, null)) { return false; @@ -422,26 +461,31 @@ namespace Google.Protobuf.Examples.AddressBook { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= people_.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { people_.WriteTo(output, _repeated_people_codec); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += people_.CalculateSize(_repeated_people_codec); return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(AddressBook other) { if (other == null) { return; @@ -449,6 +493,7 @@ namespace Google.Protobuf.Examples.AddressBook { people_.Add(other.people_); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { -- cgit v1.2.3