OLD | NEW |
1 // Generated by the protocol buffer compiler. DO NOT EDIT! | 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 // source: addressbook.proto | 2 // source: addressbook.proto |
3 #pragma warning disable 1591, 0612, 3021 | 3 #pragma warning disable 1591, 0612, 3021 |
4 #region Designer generated code | 4 #region Designer generated code |
5 | 5 |
6 using pb = global::Google.Protobuf; | 6 using pb = global::Google.Protobuf; |
7 using pbc = global::Google.Protobuf.Collections; | 7 using pbc = global::Google.Protobuf.Collections; |
8 using pbr = global::Google.Protobuf.Reflection; | 8 using pbr = global::Google.Protobuf.Reflection; |
9 using scg = global::System.Collections.Generic; | 9 using scg = global::System.Collections.Generic; |
10 namespace Google.Protobuf.Examples.AddressBook { | 10 namespace Google.Protobuf.Examples.AddressBook { |
11 | 11 |
12 /// <summary>Holder for reflection information generated from addressbook.prot
o</summary> | 12 /// <summary>Holder for reflection information generated from addressbook.prot
o</summary> |
| 13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
13 public static partial class AddressbookReflection { | 14 public static partial class AddressbookReflection { |
14 | 15 |
15 #region Descriptor | 16 #region Descriptor |
16 /// <summary>File descriptor for addressbook.proto</summary> | 17 /// <summary>File descriptor for addressbook.proto</summary> |
17 public static pbr::FileDescriptor Descriptor { | 18 public static pbr::FileDescriptor Descriptor { |
18 get { return descriptor; } | 19 get { return descriptor; } |
19 } | 20 } |
20 private static pbr::FileDescriptor descriptor; | 21 private static pbr::FileDescriptor descriptor; |
21 | 22 |
22 static AddressbookReflection() { | 23 static AddressbookReflection() { |
(...skipping 13 matching lines...) Expand all Loading... |
36 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | 37 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { |
37 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Example
s.AddressBook.Person), global::Google.Protobuf.Examples.AddressBook.Person.Parse
r, new[]{ "Name", "Id", "Email", "Phones" }, null, new[]{ typeof(global::Google.
Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, new pbr::GeneratedClrTy
peInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples
.AddressBook.Person.Types.PhoneNumber), global::Google.Protobuf.Examples.Address
Book.Person.Types.PhoneNumber.Parser, new[]{ "Number", "Type" }, null, null, nul
l)}), | 38 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Example
s.AddressBook.Person), global::Google.Protobuf.Examples.AddressBook.Person.Parse
r, new[]{ "Name", "Id", "Email", "Phones" }, null, new[]{ typeof(global::Google.
Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, new pbr::GeneratedClrTy
peInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples
.AddressBook.Person.Types.PhoneNumber), global::Google.Protobuf.Examples.Address
Book.Person.Types.PhoneNumber.Parser, new[]{ "Number", "Type" }, null, null, nul
l)}), |
38 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Example
s.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.Address
Book.Parser, new[]{ "People" }, null, null, null) | 39 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Example
s.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.Address
Book.Parser, new[]{ "People" }, null, null, null) |
39 })); | 40 })); |
40 } | 41 } |
41 #endregion | 42 #endregion |
42 | 43 |
43 } | 44 } |
44 #region Messages | 45 #region Messages |
45 /// <summary> | 46 /// <summary> |
46 /// [START messages] | 47 /// [START messages] |
47 /// </summary> | 48 /// </summary> |
| 49 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
48 public sealed partial class Person : pb::IMessage<Person> { | 50 public sealed partial class Person : pb::IMessage<Person> { |
49 private static readonly pb::MessageParser<Person> _parser = new pb::MessageP
arser<Person>(() => new Person()); | 51 private static readonly pb::MessageParser<Person> _parser = new pb::MessageP
arser<Person>(() => new Person()); |
50 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
51 public static pb::MessageParser<Person> Parser { get { return _parser; } } | 52 public static pb::MessageParser<Person> Parser { get { return _parser; } } |
52 | 53 |
53 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
54 public static pbr::MessageDescriptor Descriptor { | 54 public static pbr::MessageDescriptor Descriptor { |
55 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookRefle
ction.Descriptor.MessageTypes[0]; } | 55 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookRefle
ction.Descriptor.MessageTypes[0]; } |
56 } | 56 } |
57 | 57 |
58 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
59 pbr::MessageDescriptor pb::IMessage.Descriptor { | 58 pbr::MessageDescriptor pb::IMessage.Descriptor { |
60 get { return Descriptor; } | 59 get { return Descriptor; } |
61 } | 60 } |
62 | 61 |
63 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
64 public Person() { | 62 public Person() { |
65 OnConstruction(); | 63 OnConstruction(); |
66 } | 64 } |
67 | 65 |
68 partial void OnConstruction(); | 66 partial void OnConstruction(); |
69 | 67 |
70 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
71 public Person(Person other) : this() { | 68 public Person(Person other) : this() { |
72 name_ = other.name_; | 69 name_ = other.name_; |
73 id_ = other.id_; | 70 id_ = other.id_; |
74 email_ = other.email_; | 71 email_ = other.email_; |
75 phones_ = other.phones_.Clone(); | 72 phones_ = other.phones_.Clone(); |
76 } | 73 } |
77 | 74 |
78 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
79 public Person Clone() { | 75 public Person Clone() { |
80 return new Person(this); | 76 return new Person(this); |
81 } | 77 } |
82 | 78 |
83 /// <summary>Field number for the "name" field.</summary> | 79 /// <summary>Field number for the "name" field.</summary> |
84 public const int NameFieldNumber = 1; | 80 public const int NameFieldNumber = 1; |
85 private string name_ = ""; | 81 private string name_ = ""; |
86 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
87 public string Name { | 82 public string Name { |
88 get { return name_; } | 83 get { return name_; } |
89 set { | 84 set { |
90 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | 85 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
91 } | 86 } |
92 } | 87 } |
93 | 88 |
94 /// <summary>Field number for the "id" field.</summary> | 89 /// <summary>Field number for the "id" field.</summary> |
95 public const int IdFieldNumber = 2; | 90 public const int IdFieldNumber = 2; |
96 private int id_; | 91 private int id_; |
97 /// <summary> | 92 /// <summary> |
98 /// Unique ID number for this person. | 93 /// Unique ID number for this person. |
99 /// </summary> | 94 /// </summary> |
100 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
101 public int Id { | 95 public int Id { |
102 get { return id_; } | 96 get { return id_; } |
103 set { | 97 set { |
104 id_ = value; | 98 id_ = value; |
105 } | 99 } |
106 } | 100 } |
107 | 101 |
108 /// <summary>Field number for the "email" field.</summary> | 102 /// <summary>Field number for the "email" field.</summary> |
109 public const int EmailFieldNumber = 3; | 103 public const int EmailFieldNumber = 3; |
110 private string email_ = ""; | 104 private string email_ = ""; |
111 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
112 public string Email { | 105 public string Email { |
113 get { return email_; } | 106 get { return email_; } |
114 set { | 107 set { |
115 email_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | 108 email_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
116 } | 109 } |
117 } | 110 } |
118 | 111 |
119 /// <summary>Field number for the "phones" field.</summary> | 112 /// <summary>Field number for the "phones" field.</summary> |
120 public const int PhonesFieldNumber = 4; | 113 public const int PhonesFieldNumber = 4; |
121 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.Addr
essBook.Person.Types.PhoneNumber> _repeated_phones_codec | 114 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.Addr
essBook.Person.Types.PhoneNumber> _repeated_phones_codec |
122 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.Address
Book.Person.Types.PhoneNumber.Parser); | 115 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.Address
Book.Person.Types.PhoneNumber.Parser); |
123 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.Address
Book.Person.Types.PhoneNumber> phones_ = new pbc::RepeatedField<global::Google.P
rotobuf.Examples.AddressBook.Person.Types.PhoneNumber>(); | 116 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.Address
Book.Person.Types.PhoneNumber> phones_ = new pbc::RepeatedField<global::Google.P
rotobuf.Examples.AddressBook.Person.Types.PhoneNumber>(); |
124 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
125 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Perso
n.Types.PhoneNumber> Phones { | 117 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Perso
n.Types.PhoneNumber> Phones { |
126 get { return phones_; } | 118 get { return phones_; } |
127 } | 119 } |
128 | 120 |
129 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
130 public override bool Equals(object other) { | 121 public override bool Equals(object other) { |
131 return Equals(other as Person); | 122 return Equals(other as Person); |
132 } | 123 } |
133 | 124 |
134 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
135 public bool Equals(Person other) { | 125 public bool Equals(Person other) { |
136 if (ReferenceEquals(other, null)) { | 126 if (ReferenceEquals(other, null)) { |
137 return false; | 127 return false; |
138 } | 128 } |
139 if (ReferenceEquals(other, this)) { | 129 if (ReferenceEquals(other, this)) { |
140 return true; | 130 return true; |
141 } | 131 } |
142 if (Name != other.Name) return false; | 132 if (Name != other.Name) return false; |
143 if (Id != other.Id) return false; | 133 if (Id != other.Id) return false; |
144 if (Email != other.Email) return false; | 134 if (Email != other.Email) return false; |
145 if(!phones_.Equals(other.phones_)) return false; | 135 if(!phones_.Equals(other.phones_)) return false; |
146 return true; | 136 return true; |
147 } | 137 } |
148 | 138 |
149 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
150 public override int GetHashCode() { | 139 public override int GetHashCode() { |
151 int hash = 1; | 140 int hash = 1; |
152 if (Name.Length != 0) hash ^= Name.GetHashCode(); | 141 if (Name.Length != 0) hash ^= Name.GetHashCode(); |
153 if (Id != 0) hash ^= Id.GetHashCode(); | 142 if (Id != 0) hash ^= Id.GetHashCode(); |
154 if (Email.Length != 0) hash ^= Email.GetHashCode(); | 143 if (Email.Length != 0) hash ^= Email.GetHashCode(); |
155 hash ^= phones_.GetHashCode(); | 144 hash ^= phones_.GetHashCode(); |
156 return hash; | 145 return hash; |
157 } | 146 } |
158 | 147 |
159 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
160 public override string ToString() { | 148 public override string ToString() { |
161 return pb::JsonFormatter.ToDiagnosticString(this); | 149 return pb::JsonFormatter.ToDiagnosticString(this); |
162 } | 150 } |
163 | 151 |
164 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
165 public void WriteTo(pb::CodedOutputStream output) { | 152 public void WriteTo(pb::CodedOutputStream output) { |
166 if (Name.Length != 0) { | 153 if (Name.Length != 0) { |
167 output.WriteRawTag(10); | 154 output.WriteRawTag(10); |
168 output.WriteString(Name); | 155 output.WriteString(Name); |
169 } | 156 } |
170 if (Id != 0) { | 157 if (Id != 0) { |
171 output.WriteRawTag(16); | 158 output.WriteRawTag(16); |
172 output.WriteInt32(Id); | 159 output.WriteInt32(Id); |
173 } | 160 } |
174 if (Email.Length != 0) { | 161 if (Email.Length != 0) { |
175 output.WriteRawTag(26); | 162 output.WriteRawTag(26); |
176 output.WriteString(Email); | 163 output.WriteString(Email); |
177 } | 164 } |
178 phones_.WriteTo(output, _repeated_phones_codec); | 165 phones_.WriteTo(output, _repeated_phones_codec); |
179 } | 166 } |
180 | 167 |
181 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
182 public int CalculateSize() { | 168 public int CalculateSize() { |
183 int size = 0; | 169 int size = 0; |
184 if (Name.Length != 0) { | 170 if (Name.Length != 0) { |
185 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); | 171 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); |
186 } | 172 } |
187 if (Id != 0) { | 173 if (Id != 0) { |
188 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); | 174 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); |
189 } | 175 } |
190 if (Email.Length != 0) { | 176 if (Email.Length != 0) { |
191 size += 1 + pb::CodedOutputStream.ComputeStringSize(Email); | 177 size += 1 + pb::CodedOutputStream.ComputeStringSize(Email); |
192 } | 178 } |
193 size += phones_.CalculateSize(_repeated_phones_codec); | 179 size += phones_.CalculateSize(_repeated_phones_codec); |
194 return size; | 180 return size; |
195 } | 181 } |
196 | 182 |
197 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
198 public void MergeFrom(Person other) { | 183 public void MergeFrom(Person other) { |
199 if (other == null) { | 184 if (other == null) { |
200 return; | 185 return; |
201 } | 186 } |
202 if (other.Name.Length != 0) { | 187 if (other.Name.Length != 0) { |
203 Name = other.Name; | 188 Name = other.Name; |
204 } | 189 } |
205 if (other.Id != 0) { | 190 if (other.Id != 0) { |
206 Id = other.Id; | 191 Id = other.Id; |
207 } | 192 } |
208 if (other.Email.Length != 0) { | 193 if (other.Email.Length != 0) { |
209 Email = other.Email; | 194 Email = other.Email; |
210 } | 195 } |
211 phones_.Add(other.phones_); | 196 phones_.Add(other.phones_); |
212 } | 197 } |
213 | 198 |
214 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
215 public void MergeFrom(pb::CodedInputStream input) { | 199 public void MergeFrom(pb::CodedInputStream input) { |
216 uint tag; | 200 uint tag; |
217 while ((tag = input.ReadTag()) != 0) { | 201 while ((tag = input.ReadTag()) != 0) { |
218 switch(tag) { | 202 switch(tag) { |
219 default: | 203 default: |
220 input.SkipLastField(); | 204 input.SkipLastField(); |
221 break; | 205 break; |
222 case 10: { | 206 case 10: { |
223 Name = input.ReadString(); | 207 Name = input.ReadString(); |
224 break; | 208 break; |
225 } | 209 } |
226 case 16: { | 210 case 16: { |
227 Id = input.ReadInt32(); | 211 Id = input.ReadInt32(); |
228 break; | 212 break; |
229 } | 213 } |
230 case 26: { | 214 case 26: { |
231 Email = input.ReadString(); | 215 Email = input.ReadString(); |
232 break; | 216 break; |
233 } | 217 } |
234 case 34: { | 218 case 34: { |
235 phones_.AddEntriesFrom(input, _repeated_phones_codec); | 219 phones_.AddEntriesFrom(input, _repeated_phones_codec); |
236 break; | 220 break; |
237 } | 221 } |
238 } | 222 } |
239 } | 223 } |
240 } | 224 } |
241 | 225 |
242 #region Nested types | 226 #region Nested types |
243 /// <summary>Container for nested types declared in the Person message type.
</summary> | 227 /// <summary>Container for nested types declared in the Person message type.
</summary> |
244 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | 228 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
245 public static partial class Types { | 229 public static partial class Types { |
246 public enum PhoneType { | 230 public enum PhoneType { |
247 [pbr::OriginalName("MOBILE")] Mobile = 0, | 231 [pbr::OriginalName("MOBILE")] Mobile = 0, |
248 [pbr::OriginalName("HOME")] Home = 1, | 232 [pbr::OriginalName("HOME")] Home = 1, |
249 [pbr::OriginalName("WORK")] Work = 2, | 233 [pbr::OriginalName("WORK")] Work = 2, |
250 } | 234 } |
251 | 235 |
| 236 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
252 public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber> { | 237 public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber> { |
253 private static readonly pb::MessageParser<PhoneNumber> _parser = new pb:
:MessageParser<PhoneNumber>(() => new PhoneNumber()); | 238 private static readonly pb::MessageParser<PhoneNumber> _parser = new pb:
:MessageParser<PhoneNumber>(() => new PhoneNumber()); |
254 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
255 public static pb::MessageParser<PhoneNumber> Parser { get { return _pars
er; } } | 239 public static pb::MessageParser<PhoneNumber> Parser { get { return _pars
er; } } |
256 | 240 |
257 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
258 public static pbr::MessageDescriptor Descriptor { | 241 public static pbr::MessageDescriptor Descriptor { |
259 get { return global::Google.Protobuf.Examples.AddressBook.Person.Descr
iptor.NestedTypes[0]; } | 242 get { return global::Google.Protobuf.Examples.AddressBook.Person.Descr
iptor.NestedTypes[0]; } |
260 } | 243 } |
261 | 244 |
262 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
263 pbr::MessageDescriptor pb::IMessage.Descriptor { | 245 pbr::MessageDescriptor pb::IMessage.Descriptor { |
264 get { return Descriptor; } | 246 get { return Descriptor; } |
265 } | 247 } |
266 | 248 |
267 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
268 public PhoneNumber() { | 249 public PhoneNumber() { |
269 OnConstruction(); | 250 OnConstruction(); |
270 } | 251 } |
271 | 252 |
272 partial void OnConstruction(); | 253 partial void OnConstruction(); |
273 | 254 |
274 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
275 public PhoneNumber(PhoneNumber other) : this() { | 255 public PhoneNumber(PhoneNumber other) : this() { |
276 number_ = other.number_; | 256 number_ = other.number_; |
277 type_ = other.type_; | 257 type_ = other.type_; |
278 } | 258 } |
279 | 259 |
280 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
281 public PhoneNumber Clone() { | 260 public PhoneNumber Clone() { |
282 return new PhoneNumber(this); | 261 return new PhoneNumber(this); |
283 } | 262 } |
284 | 263 |
285 /// <summary>Field number for the "number" field.</summary> | 264 /// <summary>Field number for the "number" field.</summary> |
286 public const int NumberFieldNumber = 1; | 265 public const int NumberFieldNumber = 1; |
287 private string number_ = ""; | 266 private string number_ = ""; |
288 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
289 public string Number { | 267 public string Number { |
290 get { return number_; } | 268 get { return number_; } |
291 set { | 269 set { |
292 number_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | 270 number_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
293 } | 271 } |
294 } | 272 } |
295 | 273 |
296 /// <summary>Field number for the "type" field.</summary> | 274 /// <summary>Field number for the "type" field.</summary> |
297 public const int TypeFieldNumber = 2; | 275 public const int TypeFieldNumber = 2; |
298 private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneT
ype type_ = 0; | 276 private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneT
ype type_ = 0; |
299 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
300 public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneTy
pe Type { | 277 public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneTy
pe Type { |
301 get { return type_; } | 278 get { return type_; } |
302 set { | 279 set { |
303 type_ = value; | 280 type_ = value; |
304 } | 281 } |
305 } | 282 } |
306 | 283 |
307 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
308 public override bool Equals(object other) { | 284 public override bool Equals(object other) { |
309 return Equals(other as PhoneNumber); | 285 return Equals(other as PhoneNumber); |
310 } | 286 } |
311 | 287 |
312 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
313 public bool Equals(PhoneNumber other) { | 288 public bool Equals(PhoneNumber other) { |
314 if (ReferenceEquals(other, null)) { | 289 if (ReferenceEquals(other, null)) { |
315 return false; | 290 return false; |
316 } | 291 } |
317 if (ReferenceEquals(other, this)) { | 292 if (ReferenceEquals(other, this)) { |
318 return true; | 293 return true; |
319 } | 294 } |
320 if (Number != other.Number) return false; | 295 if (Number != other.Number) return false; |
321 if (Type != other.Type) return false; | 296 if (Type != other.Type) return false; |
322 return true; | 297 return true; |
323 } | 298 } |
324 | 299 |
325 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
326 public override int GetHashCode() { | 300 public override int GetHashCode() { |
327 int hash = 1; | 301 int hash = 1; |
328 if (Number.Length != 0) hash ^= Number.GetHashCode(); | 302 if (Number.Length != 0) hash ^= Number.GetHashCode(); |
329 if (Type != 0) hash ^= Type.GetHashCode(); | 303 if (Type != 0) hash ^= Type.GetHashCode(); |
330 return hash; | 304 return hash; |
331 } | 305 } |
332 | 306 |
333 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
334 public override string ToString() { | 307 public override string ToString() { |
335 return pb::JsonFormatter.ToDiagnosticString(this); | 308 return pb::JsonFormatter.ToDiagnosticString(this); |
336 } | 309 } |
337 | 310 |
338 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
339 public void WriteTo(pb::CodedOutputStream output) { | 311 public void WriteTo(pb::CodedOutputStream output) { |
340 if (Number.Length != 0) { | 312 if (Number.Length != 0) { |
341 output.WriteRawTag(10); | 313 output.WriteRawTag(10); |
342 output.WriteString(Number); | 314 output.WriteString(Number); |
343 } | 315 } |
344 if (Type != 0) { | 316 if (Type != 0) { |
345 output.WriteRawTag(16); | 317 output.WriteRawTag(16); |
346 output.WriteEnum((int) Type); | 318 output.WriteEnum((int) Type); |
347 } | 319 } |
348 } | 320 } |
349 | 321 |
350 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
351 public int CalculateSize() { | 322 public int CalculateSize() { |
352 int size = 0; | 323 int size = 0; |
353 if (Number.Length != 0) { | 324 if (Number.Length != 0) { |
354 size += 1 + pb::CodedOutputStream.ComputeStringSize(Number); | 325 size += 1 + pb::CodedOutputStream.ComputeStringSize(Number); |
355 } | 326 } |
356 if (Type != 0) { | 327 if (Type != 0) { |
357 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); | 328 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); |
358 } | 329 } |
359 return size; | 330 return size; |
360 } | 331 } |
361 | 332 |
362 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
363 public void MergeFrom(PhoneNumber other) { | 333 public void MergeFrom(PhoneNumber other) { |
364 if (other == null) { | 334 if (other == null) { |
365 return; | 335 return; |
366 } | 336 } |
367 if (other.Number.Length != 0) { | 337 if (other.Number.Length != 0) { |
368 Number = other.Number; | 338 Number = other.Number; |
369 } | 339 } |
370 if (other.Type != 0) { | 340 if (other.Type != 0) { |
371 Type = other.Type; | 341 Type = other.Type; |
372 } | 342 } |
373 } | 343 } |
374 | 344 |
375 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
376 public void MergeFrom(pb::CodedInputStream input) { | 345 public void MergeFrom(pb::CodedInputStream input) { |
377 uint tag; | 346 uint tag; |
378 while ((tag = input.ReadTag()) != 0) { | 347 while ((tag = input.ReadTag()) != 0) { |
379 switch(tag) { | 348 switch(tag) { |
380 default: | 349 default: |
381 input.SkipLastField(); | 350 input.SkipLastField(); |
382 break; | 351 break; |
383 case 10: { | 352 case 10: { |
384 Number = input.ReadString(); | 353 Number = input.ReadString(); |
385 break; | 354 break; |
386 } | 355 } |
387 case 16: { | 356 case 16: { |
388 type_ = (global::Google.Protobuf.Examples.AddressBook.Person.Typ
es.PhoneType) input.ReadEnum(); | 357 type_ = (global::Google.Protobuf.Examples.AddressBook.Person.Typ
es.PhoneType) input.ReadEnum(); |
389 break; | 358 break; |
390 } | 359 } |
391 } | 360 } |
392 } | 361 } |
393 } | 362 } |
394 | 363 |
395 } | 364 } |
396 | 365 |
397 } | 366 } |
398 #endregion | 367 #endregion |
399 | 368 |
400 } | 369 } |
401 | 370 |
402 /// <summary> | 371 /// <summary> |
403 /// Our address book file is just one of these. | 372 /// Our address book file is just one of these. |
404 /// </summary> | 373 /// </summary> |
| 374 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
405 public sealed partial class AddressBook : pb::IMessage<AddressBook> { | 375 public sealed partial class AddressBook : pb::IMessage<AddressBook> { |
406 private static readonly pb::MessageParser<AddressBook> _parser = new pb::Mes
sageParser<AddressBook>(() => new AddressBook()); | 376 private static readonly pb::MessageParser<AddressBook> _parser = new pb::Mes
sageParser<AddressBook>(() => new AddressBook()); |
407 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
408 public static pb::MessageParser<AddressBook> Parser { get { return _parser;
} } | 377 public static pb::MessageParser<AddressBook> Parser { get { return _parser;
} } |
409 | 378 |
410 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
411 public static pbr::MessageDescriptor Descriptor { | 379 public static pbr::MessageDescriptor Descriptor { |
412 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookRefle
ction.Descriptor.MessageTypes[1]; } | 380 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookRefle
ction.Descriptor.MessageTypes[1]; } |
413 } | 381 } |
414 | 382 |
415 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
416 pbr::MessageDescriptor pb::IMessage.Descriptor { | 383 pbr::MessageDescriptor pb::IMessage.Descriptor { |
417 get { return Descriptor; } | 384 get { return Descriptor; } |
418 } | 385 } |
419 | 386 |
420 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
421 public AddressBook() { | 387 public AddressBook() { |
422 OnConstruction(); | 388 OnConstruction(); |
423 } | 389 } |
424 | 390 |
425 partial void OnConstruction(); | 391 partial void OnConstruction(); |
426 | 392 |
427 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
428 public AddressBook(AddressBook other) : this() { | 393 public AddressBook(AddressBook other) : this() { |
429 people_ = other.people_.Clone(); | 394 people_ = other.people_.Clone(); |
430 } | 395 } |
431 | 396 |
432 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
433 public AddressBook Clone() { | 397 public AddressBook Clone() { |
434 return new AddressBook(this); | 398 return new AddressBook(this); |
435 } | 399 } |
436 | 400 |
437 /// <summary>Field number for the "people" field.</summary> | 401 /// <summary>Field number for the "people" field.</summary> |
438 public const int PeopleFieldNumber = 1; | 402 public const int PeopleFieldNumber = 1; |
439 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.Addr
essBook.Person> _repeated_people_codec | 403 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.Addr
essBook.Person> _repeated_people_codec |
440 = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.Address
Book.Person.Parser); | 404 = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.Address
Book.Person.Parser); |
441 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.Address
Book.Person> people_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.A
ddressBook.Person>(); | 405 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.Address
Book.Person> people_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.A
ddressBook.Person>(); |
442 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
443 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Perso
n> People { | 406 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Perso
n> People { |
444 get { return people_; } | 407 get { return people_; } |
445 } | 408 } |
446 | 409 |
447 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
448 public override bool Equals(object other) { | 410 public override bool Equals(object other) { |
449 return Equals(other as AddressBook); | 411 return Equals(other as AddressBook); |
450 } | 412 } |
451 | 413 |
452 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
453 public bool Equals(AddressBook other) { | 414 public bool Equals(AddressBook other) { |
454 if (ReferenceEquals(other, null)) { | 415 if (ReferenceEquals(other, null)) { |
455 return false; | 416 return false; |
456 } | 417 } |
457 if (ReferenceEquals(other, this)) { | 418 if (ReferenceEquals(other, this)) { |
458 return true; | 419 return true; |
459 } | 420 } |
460 if(!people_.Equals(other.people_)) return false; | 421 if(!people_.Equals(other.people_)) return false; |
461 return true; | 422 return true; |
462 } | 423 } |
463 | 424 |
464 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
465 public override int GetHashCode() { | 425 public override int GetHashCode() { |
466 int hash = 1; | 426 int hash = 1; |
467 hash ^= people_.GetHashCode(); | 427 hash ^= people_.GetHashCode(); |
468 return hash; | 428 return hash; |
469 } | 429 } |
470 | 430 |
471 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
472 public override string ToString() { | 431 public override string ToString() { |
473 return pb::JsonFormatter.ToDiagnosticString(this); | 432 return pb::JsonFormatter.ToDiagnosticString(this); |
474 } | 433 } |
475 | 434 |
476 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
477 public void WriteTo(pb::CodedOutputStream output) { | 435 public void WriteTo(pb::CodedOutputStream output) { |
478 people_.WriteTo(output, _repeated_people_codec); | 436 people_.WriteTo(output, _repeated_people_codec); |
479 } | 437 } |
480 | 438 |
481 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
482 public int CalculateSize() { | 439 public int CalculateSize() { |
483 int size = 0; | 440 int size = 0; |
484 size += people_.CalculateSize(_repeated_people_codec); | 441 size += people_.CalculateSize(_repeated_people_codec); |
485 return size; | 442 return size; |
486 } | 443 } |
487 | 444 |
488 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
489 public void MergeFrom(AddressBook other) { | 445 public void MergeFrom(AddressBook other) { |
490 if (other == null) { | 446 if (other == null) { |
491 return; | 447 return; |
492 } | 448 } |
493 people_.Add(other.people_); | 449 people_.Add(other.people_); |
494 } | 450 } |
495 | 451 |
496 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |
497 public void MergeFrom(pb::CodedInputStream input) { | 452 public void MergeFrom(pb::CodedInputStream input) { |
498 uint tag; | 453 uint tag; |
499 while ((tag = input.ReadTag()) != 0) { | 454 while ((tag = input.ReadTag()) != 0) { |
500 switch(tag) { | 455 switch(tag) { |
501 default: | 456 default: |
502 input.SkipLastField(); | 457 input.SkipLastField(); |
503 break; | 458 break; |
504 case 10: { | 459 case 10: { |
505 people_.AddEntriesFrom(input, _repeated_people_codec); | 460 people_.AddEntriesFrom(input, _repeated_people_codec); |
506 break; | 461 break; |
507 } | 462 } |
508 } | 463 } |
509 } | 464 } |
510 } | 465 } |
511 | 466 |
512 } | 467 } |
513 | 468 |
514 #endregion | 469 #endregion |
515 | 470 |
516 } | 471 } |
517 | 472 |
518 #endregion Designer generated code | 473 #endregion Designer generated code |
OLD | NEW |