OLD | NEW |
1 #region Copyright notice and license | 1 #region Copyright notice and license |
2 // Protocol Buffers - Google's data interchange format | 2 // Protocol Buffers - Google's data interchange format |
3 // Copyright 2008 Google Inc. All rights reserved. | 3 // Copyright 2008 Google Inc. All rights reserved. |
4 // https://developers.google.com/protocol-buffers/ | 4 // https://developers.google.com/protocol-buffers/ |
5 // | 5 // |
6 // Redistribution and use in source and binary forms, with or without | 6 // Redistribution and use in source and binary forms, with or without |
7 // modification, are permitted provided that the following conditions are | 7 // modification, are permitted provided that the following conditions are |
8 // met: | 8 // met: |
9 // | 9 // |
10 // * Redistributions of source code must retain the above copyright | 10 // * Redistributions of source code must retain the above copyright |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 // Validate that the dependencies we've been passed (as FileDescript
ors) are actually the ones we | 245 // Validate that the dependencies we've been passed (as FileDescript
ors) are actually the ones we |
246 // need. | 246 // need. |
247 if (dependencies.Length != proto.Dependency.Count) | 247 if (dependencies.Length != proto.Dependency.Count) |
248 { | 248 { |
249 throw new DescriptorValidationException( | 249 throw new DescriptorValidationException( |
250 result, | 250 result, |
251 "Dependencies passed to FileDescriptor.BuildFrom() don't mat
ch " + | 251 "Dependencies passed to FileDescriptor.BuildFrom() don't mat
ch " + |
252 "those listed in the FileDescriptorProto."); | 252 "those listed in the FileDescriptorProto."); |
253 } | 253 } |
254 for (int i = 0; i < proto.Dependency.Count; i++) | |
255 { | |
256 if (dependencies[i].Name != proto.Dependency[i]) | |
257 { | |
258 throw new DescriptorValidationException( | |
259 result, | |
260 "Dependencies passed to FileDescriptor.BuildFrom() don't
match " + | |
261 "those listed in the FileDescriptorProto. Expected: " + | |
262 proto.Dependency[i] + " but was: " + dependencies[i].Nam
e); | |
263 } | |
264 } | |
265 | 254 |
266 result.CrossLink(); | 255 result.CrossLink(); |
267 return result; | 256 return result; |
268 } | 257 } |
269 | 258 |
270 private void CrossLink() | 259 private void CrossLink() |
271 { | 260 { |
272 foreach (MessageDescriptor message in MessageTypes) | 261 foreach (MessageDescriptor message in MessageTypes) |
273 { | 262 { |
274 message.CrossLink(); | 263 message.CrossLink(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 /// annotations. While <c>descriptor.proto</c> is a proto2 file, it is b
uilt into the Google.Protobuf | 323 /// annotations. While <c>descriptor.proto</c> is a proto2 file, it is b
uilt into the Google.Protobuf |
335 /// runtime for reflection purposes. The messages are internal to the ru
ntime as they would require | 324 /// runtime for reflection purposes. The messages are internal to the ru
ntime as they would require |
336 /// proto2 semantics for full support, but the file descriptor is availa
ble via this property. The | 325 /// proto2 semantics for full support, but the file descriptor is availa
ble via this property. The |
337 /// C# codegen in protoc automatically uses this property when it detect
s a dependency on <c>descriptor.proto</c>. | 326 /// C# codegen in protoc automatically uses this property when it detect
s a dependency on <c>descriptor.proto</c>. |
338 /// </remarks> | 327 /// </remarks> |
339 /// <value> | 328 /// <value> |
340 /// The file descriptor for <c>descriptor.proto</c>. | 329 /// The file descriptor for <c>descriptor.proto</c>. |
341 /// </value> | 330 /// </value> |
342 public static FileDescriptor DescriptorProtoFileDescriptor { get { retur
n DescriptorReflection.Descriptor; } } | 331 public static FileDescriptor DescriptorProtoFileDescriptor { get { retur
n DescriptorReflection.Descriptor; } } |
343 } | 332 } |
344 } | 333 } |
OLD | NEW |