Commit 49b31dc5 authored by Feng Xiao's avatar Feng Xiao

Update C# generated file for addressbook.proto

parent 49b88af4
...@@ -22,19 +22,21 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -22,19 +22,21 @@ namespace Google.Protobuf.Examples.AddressBook {
static AddressbookReflection() { static AddressbookReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String( byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat( string.Concat(
"ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi1QEKBlBlcnNvbhIMCgRu", "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaH2dvb2dsZS9wcm90b2J1",
"YW1lGAEgASgJEgoKAmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25l", "Zi90aW1lc3RhbXAucHJvdG8ihwIKBlBlcnNvbhIMCgRuYW1lGAEgASgJEgoK",
"cxgEIAMoCzIcLnR1dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchpHCgtQaG9u", "AmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25lcxgEIAMoCzIcLnR1",
"ZU51bWJlchIOCgZudW1iZXIYASABKAkSKAoEdHlwZRgCIAEoDjIaLnR1dG9y", "dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchIwCgxsYXN0X3VwZGF0ZWQYBSAB",
"aWFsLlBlcnNvbi5QaG9uZVR5cGUiKwoJUGhvbmVUeXBlEgoKBk1PQklMRRAA", "KAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wGkcKC1Bob25lTnVtYmVy",
"EggKBEhPTUUQARIICgRXT1JLEAIiLwoLQWRkcmVzc0Jvb2sSIAoGcGVvcGxl", "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy",
"GAEgAygLMhAudHV0b3JpYWwuUGVyc29uQlAKFGNvbS5leGFtcGxlLnR1dG9y", "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N",
"aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt", "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy",
"cGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z")); "EC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3JpYWxCEUFk",
"ZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1wbGVzLkFk",
"ZHJlc3NCb29rYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person), global::Google.Protobuf.Examples.AddressBook.Person.Parser, new[]{ "Name", "Id", "Email", "Phones" }, null, new[]{ typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, 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)}), 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) }, 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)}),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.AddressBook.Parser, new[]{ "People" }, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.AddressBook.Parser, new[]{ "People" }, null, null, null)
})); }));
} }
...@@ -73,6 +75,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -73,6 +75,7 @@ namespace Google.Protobuf.Examples.AddressBook {
id_ = other.id_; id_ = other.id_;
email_ = other.email_; email_ = other.email_;
phones_ = other.phones_.Clone(); phones_ = other.phones_.Clone();
LastUpdated = other.lastUpdated_ != null ? other.LastUpdated.Clone() : null;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
...@@ -126,6 +129,17 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -126,6 +129,17 @@ namespace Google.Protobuf.Examples.AddressBook {
get { return phones_; } get { return phones_; }
} }
/// <summary>Field number for the "last_updated" field.</summary>
public const int LastUpdatedFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.Timestamp lastUpdated_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Timestamp LastUpdated {
get { return lastUpdated_; }
set {
lastUpdated_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as Person); return Equals(other as Person);
...@@ -143,6 +157,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -143,6 +157,7 @@ namespace Google.Protobuf.Examples.AddressBook {
if (Id != other.Id) return false; if (Id != other.Id) return false;
if (Email != other.Email) return false; if (Email != other.Email) return false;
if(!phones_.Equals(other.phones_)) return false; if(!phones_.Equals(other.phones_)) return false;
if (!object.Equals(LastUpdated, other.LastUpdated)) return false;
return true; return true;
} }
...@@ -153,6 +168,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -153,6 +168,7 @@ namespace Google.Protobuf.Examples.AddressBook {
if (Id != 0) hash ^= Id.GetHashCode(); if (Id != 0) hash ^= Id.GetHashCode();
if (Email.Length != 0) hash ^= Email.GetHashCode(); if (Email.Length != 0) hash ^= Email.GetHashCode();
hash ^= phones_.GetHashCode(); hash ^= phones_.GetHashCode();
if (lastUpdated_ != null) hash ^= LastUpdated.GetHashCode();
return hash; return hash;
} }
...@@ -176,6 +192,10 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -176,6 +192,10 @@ namespace Google.Protobuf.Examples.AddressBook {
output.WriteString(Email); output.WriteString(Email);
} }
phones_.WriteTo(output, _repeated_phones_codec); phones_.WriteTo(output, _repeated_phones_codec);
if (lastUpdated_ != null) {
output.WriteRawTag(42);
output.WriteMessage(LastUpdated);
}
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
...@@ -191,6 +211,9 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -191,6 +211,9 @@ namespace Google.Protobuf.Examples.AddressBook {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Email); size += 1 + pb::CodedOutputStream.ComputeStringSize(Email);
} }
size += phones_.CalculateSize(_repeated_phones_codec); size += phones_.CalculateSize(_repeated_phones_codec);
if (lastUpdated_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(LastUpdated);
}
return size; return size;
} }
...@@ -209,6 +232,12 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -209,6 +232,12 @@ namespace Google.Protobuf.Examples.AddressBook {
Email = other.Email; Email = other.Email;
} }
phones_.Add(other.phones_); phones_.Add(other.phones_);
if (other.lastUpdated_ != null) {
if (lastUpdated_ == null) {
lastUpdated_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
LastUpdated.MergeFrom(other.LastUpdated);
}
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
...@@ -235,6 +264,13 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -235,6 +264,13 @@ namespace Google.Protobuf.Examples.AddressBook {
phones_.AddEntriesFrom(input, _repeated_phones_codec); phones_.AddEntriesFrom(input, _repeated_phones_codec);
break; break;
} }
case 42: {
if (lastUpdated_ == null) {
lastUpdated_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
input.ReadMessage(lastUpdated_);
break;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment