FieldSet.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using Google.ProtocolBuffers.Descriptors;
  6. using Google.ProtocolBuffers.Collections;
  7. namespace Google.ProtocolBuffers {
  8. /// <summary>
  9. /// A class which represents an arbitrary set of fields of some message type.
  10. /// This is used to implement DynamicMessage, and also to represent extensions
  11. /// in GeneratedMessage. This class is internal, since outside users should probably
  12. /// be using DynamicMessage.
  13. ///
  14. /// As in the Java implementation, this class goes against the rest of the framework
  15. /// in terms of mutability. Instead of having a mutable Builder class and an immutable
  16. /// FieldSet class, FieldSet just has a MakeImmutable() method. This is safe so long as
  17. /// all callers are careful not to let a mutable FieldSet escape into the open. This would
  18. /// be impossible to guarantee if this were a public class, of course.
  19. ///
  20. /// All repeated fields are stored as IList[object] even
  21. /// </summary>
  22. internal class FieldSet {
  23. private static readonly FieldSet defaultInstance = new FieldSet(new Dictionary<FieldDescriptor, object>()).MakeImmutable();
  24. private IDictionary<FieldDescriptor, object> fields;
  25. private FieldSet(IDictionary<FieldDescriptor, object> fields) {
  26. this.fields = fields;
  27. }
  28. public static FieldSet CreateFieldSet() {
  29. return new FieldSet(new Dictionary<FieldDescriptor, object>());
  30. }
  31. /// <summary>
  32. /// Makes this FieldSet immutable, and returns it for convenience. Any
  33. /// mutable repeated fields are made immutable, as well as the map itself.
  34. /// </summary>
  35. internal FieldSet MakeImmutable() {
  36. // First check if we have any repeated values
  37. bool hasRepeats = false;
  38. foreach (object value in fields.Values) {
  39. IList<object> list = value as IList<object>;
  40. if (list != null && !list.IsReadOnly) {
  41. hasRepeats = true;
  42. break;
  43. }
  44. }
  45. if (hasRepeats) {
  46. var tmp = new SortedList<FieldDescriptor, object>();
  47. foreach (KeyValuePair<FieldDescriptor, object> entry in fields) {
  48. IList<object> list = entry.Value as IList<object>;
  49. tmp[entry.Key] = list == null ? entry.Value : Lists.AsReadOnly(list);
  50. }
  51. fields = tmp;
  52. }
  53. fields = Dictionaries.AsReadOnly(fields);
  54. return this;
  55. }
  56. /// <summary>
  57. /// Returns the default, immutable instance with no fields defined.
  58. /// </summary>
  59. internal static FieldSet DefaultInstance {
  60. get { return defaultInstance; }
  61. }
  62. /// <summary>
  63. /// Returns an immutable mapping of fields. Note that although the mapping itself
  64. /// is immutable, the entries may not be (i.e. any repeated values are represented by
  65. /// mutable lists). The behaviour is not specified if the contents are mutated.
  66. /// </summary>
  67. internal IDictionary<FieldDescriptor, object> AllFields {
  68. get { return Dictionaries.AsReadOnly(fields); }
  69. }
  70. /// <summary>
  71. /// See <see cref="IMessage.HasField"/>.
  72. /// </summary>
  73. public bool HasField(FieldDescriptor field) {
  74. if (field.IsRepeated) {
  75. throw new ArgumentException("HasField() can only be called on non-repeated fields.");
  76. }
  77. return fields.ContainsKey(field);
  78. }
  79. // TODO(jonskeet): Should this be in UnknownFieldSet.Builder really? Or CodedInputStream?
  80. internal static void MergeFrom(CodedInputStream input,
  81. UnknownFieldSet.Builder unknownFields,
  82. ExtensionRegistry extensionRegistry,
  83. IBuilder builder) {
  84. while (true) {
  85. uint tag = input.ReadTag();
  86. if (tag == 0) {
  87. break;
  88. }
  89. if (!MergeFieldFrom(input, unknownFields, extensionRegistry,
  90. builder, tag)) {
  91. // end group tag
  92. break;
  93. }
  94. }
  95. }
  96. // TODO(jonskeet): Should this be in UnknownFieldSet.Builder really? Or CodedInputStream?
  97. /// <summary>
  98. /// Like <see cref="MergeFrom(CodedInputStream, UnknownFieldSet.Builder, ExtensionRegistry, IBuilder)" />
  99. /// but parses a single field.
  100. /// </summary>
  101. /// <param name="input">The input to read the field from</param>
  102. /// <param name="unknownFields">The set of unknown fields to add the newly-read field to, if it's not a known field</param>
  103. /// <param name="extensionRegistry">Registry to use when an extension field is encountered</param>
  104. /// <param name="builder">Builder to merge field into, if it's a known field</param>
  105. /// <param name="tag">The tag, which should already have been read from the input</param>
  106. /// <returns>true unless the tag is an end-group tag</returns>
  107. internal static bool MergeFieldFrom(CodedInputStream input,
  108. UnknownFieldSet.Builder unknownFields,
  109. ExtensionRegistry extensionRegistry,
  110. IBuilder builder,
  111. uint tag) {
  112. MessageDescriptor type = builder.DescriptorForType;
  113. if (type.Options.MessageSetWireFormat
  114. && tag == WireFormat.MessageSetTag.ItemStart) {
  115. MergeMessageSetExtensionFromCodedStream(input, unknownFields, extensionRegistry, builder);
  116. return true;
  117. }
  118. WireFormat.WireType wireType = WireFormat.GetTagWireType(tag);
  119. int fieldNumber = WireFormat.GetTagFieldNumber(tag);
  120. FieldDescriptor field;
  121. IMessage defaultFieldInstance = null;
  122. if (type.IsExtensionNumber(fieldNumber)) {
  123. ExtensionInfo extension = extensionRegistry[type, fieldNumber];
  124. if (extension == null) {
  125. field = null;
  126. } else {
  127. field = extension.Descriptor;
  128. defaultFieldInstance = extension.DefaultInstance;
  129. }
  130. } else {
  131. field = type.FindFieldByNumber(fieldNumber);
  132. }
  133. // Unknown field or wrong wire type. Skip.
  134. if (field == null || wireType != WireFormat.FieldTypeToWireFormatMap[field.FieldType]) {
  135. return unknownFields.MergeFieldFrom(tag, input);
  136. }
  137. object value;
  138. switch (field.FieldType) {
  139. case FieldType.Group:
  140. case FieldType.Message: {
  141. IBuilder subBuilder;
  142. if (defaultFieldInstance != null) {
  143. subBuilder = defaultFieldInstance.CreateBuilderForType();
  144. } else {
  145. subBuilder = builder.CreateBuilderForField(field);
  146. }
  147. if (!field.IsRepeated) {
  148. subBuilder.MergeFrom((IMessage) builder[field]);
  149. }
  150. if (field.FieldType == FieldType.Group) {
  151. input.ReadGroup(field.FieldNumber, subBuilder, extensionRegistry);
  152. } else {
  153. input.ReadMessage(subBuilder, extensionRegistry);
  154. }
  155. value = subBuilder.Build();
  156. break;
  157. }
  158. case FieldType.Enum: {
  159. int rawValue = input.ReadEnum();
  160. value = field.EnumType.FindValueByNumber(rawValue);
  161. // If the number isn't recognized as a valid value for this enum,
  162. // drop it.
  163. if (value == null) {
  164. unknownFields.MergeVarintField(fieldNumber, (ulong) rawValue);
  165. return true;
  166. }
  167. break;
  168. }
  169. default:
  170. value = input.ReadPrimitiveField(field.FieldType);
  171. break;
  172. }
  173. if (field.IsRepeated) {
  174. builder.AddRepeatedField(field, value);
  175. } else {
  176. builder[field] = value;
  177. }
  178. return true;
  179. }
  180. // TODO(jonskeet): Should this be in UnknownFieldSet.Builder really? Or CodedInputStream?
  181. /// <summary>
  182. /// Called by MergeFieldFrom to parse a MessageSet extension.
  183. /// </summary>
  184. private static void MergeMessageSetExtensionFromCodedStream(CodedInputStream input,
  185. UnknownFieldSet.Builder unknownFields,
  186. ExtensionRegistry extensionRegistry,
  187. IBuilder builder) {
  188. MessageDescriptor type = builder.DescriptorForType;
  189. // The wire format for MessageSet is:
  190. // message MessageSet {
  191. // repeated group Item = 1 {
  192. // required int32 typeId = 2;
  193. // required bytes message = 3;
  194. // }
  195. // }
  196. // "typeId" is the extension's field number. The extension can only be
  197. // a message type, where "message" contains the encoded bytes of that
  198. // message.
  199. //
  200. // In practice, we will probably never see a MessageSet item in which
  201. // the message appears before the type ID, or where either field does not
  202. // appear exactly once. However, in theory such cases are valid, so we
  203. // should be prepared to accept them.
  204. int typeId = 0;
  205. ByteString rawBytes = null; // If we encounter "message" before "typeId"
  206. IBuilder subBuilder = null;
  207. FieldDescriptor field = null;
  208. while (true) {
  209. uint tag = input.ReadTag();
  210. if (tag == 0) {
  211. break;
  212. }
  213. if (tag == WireFormat.MessageSetTag.TypeID) {
  214. typeId = input.ReadInt32();
  215. // Zero is not a valid type ID.
  216. if (typeId != 0) {
  217. ExtensionInfo extension = extensionRegistry[type, typeId];
  218. if (extension != null) {
  219. field = extension.Descriptor;
  220. subBuilder = extension.DefaultInstance.CreateBuilderForType();
  221. IMessage originalMessage = (IMessage) builder[field];
  222. if (originalMessage != null) {
  223. subBuilder.MergeFrom(originalMessage);
  224. }
  225. if (rawBytes != null) {
  226. // We already encountered the message. Parse it now.
  227. // TODO(jonskeet): Check this is okay. It's subtly different from the Java, as it doesn't create an input stream from rawBytes.
  228. // In fact, why don't we just call MergeFrom(rawBytes)? And what about the extension registry?
  229. subBuilder.MergeFrom(rawBytes.CreateCodedInput());
  230. rawBytes = null;
  231. }
  232. } else {
  233. // Unknown extension number. If we already saw data, put it
  234. // in rawBytes.
  235. if (rawBytes != null) {
  236. unknownFields.MergeField(typeId,
  237. UnknownField.CreateBuilder()
  238. .AddLengthDelimited(rawBytes)
  239. .Build());
  240. rawBytes = null;
  241. }
  242. }
  243. }
  244. } else if (tag == WireFormat.MessageSetTag.Message) {
  245. if (typeId == 0) {
  246. // We haven't seen a type ID yet, so we have to store the raw bytes for now.
  247. rawBytes = input.ReadBytes();
  248. } else if (subBuilder == null) {
  249. // We don't know how to parse this. Ignore it.
  250. unknownFields.MergeField(typeId,
  251. UnknownField.CreateBuilder()
  252. .AddLengthDelimited(input.ReadBytes())
  253. .Build());
  254. } else {
  255. // We already know the type, so we can parse directly from the input
  256. // with no copying. Hooray!
  257. input.ReadMessage(subBuilder, extensionRegistry);
  258. }
  259. } else {
  260. // Unknown tag. Skip it.
  261. if (!input.SkipField(tag)) {
  262. break; // end of group
  263. }
  264. }
  265. }
  266. input.CheckLastTagWas(WireFormat.MessageSetTag.ItemEnd);
  267. if (subBuilder != null) {
  268. builder[field] = subBuilder.Build();
  269. }
  270. }
  271. /// <summary>
  272. /// Clears all fields.
  273. /// </summary>
  274. internal void Clear() {
  275. fields.Clear();
  276. }
  277. /// <summary>
  278. /// See <see cref="IMessage.Item(FieldDescriptor)"/>
  279. /// </summary>
  280. /// <remarks>
  281. /// If the field is not set, the behaviour when fetching this property varies by field type:
  282. /// <list>
  283. /// <item>For singular message values, null is returned.</item>
  284. /// <item>For singular non-message values, the default value of the field is returned.</item>
  285. /// <item>For repeated values, an empty immutable list is returned. This will be compatible
  286. /// with IList[object], regardless of the type of the repeated item.</item>
  287. /// </list>
  288. /// This method returns null if the field is a singular message type
  289. /// and is not set; in this case it is up to the caller to fetch the
  290. /// message's default instance. For repeated fields of message types,
  291. /// an empty collection is returned. For repeated fields of non-message
  292. /// types, null is returned.
  293. /// <para />
  294. /// When setting this property, any list values are copied, and each element is checked
  295. /// to ensure it is of an appropriate type.
  296. /// </remarks>
  297. ///
  298. internal object this[FieldDescriptor field] {
  299. get {
  300. object result;
  301. if (fields.TryGetValue(field, out result)) {
  302. return result;
  303. }
  304. // This will just do the right thing
  305. return field.DefaultValue;
  306. }
  307. set {
  308. if (field.IsRepeated) {
  309. List<object> list = value as List<object>;
  310. if (list == null) {
  311. throw new ArgumentException("Wrong object type used with protocol message reflection.");
  312. }
  313. // Wrap the contents in a new list so that the caller cannot change
  314. // the list's contents after setting it.
  315. List<object> newList = new List<object>(list);
  316. foreach (object element in newList) {
  317. VerifyType(field, element);
  318. }
  319. value = newList;
  320. }
  321. else {
  322. VerifyType(field, value);
  323. }
  324. fields[field] = value;
  325. }
  326. }
  327. /// <summary>
  328. /// See <see cref="IMessage.Item(FieldDescriptor,int)" />
  329. /// </summary>
  330. internal object this[FieldDescriptor field, int index] {
  331. get {
  332. if (!field.IsRepeated) {
  333. throw new ArgumentException("Indexer specifying field and index can only be called on repeated fields.");
  334. }
  335. return ((IList<object>) this[field])[index];
  336. }
  337. set {
  338. if (!field.IsRepeated) {
  339. throw new ArgumentException("Indexer specifying field and index can only be called on repeated fields.");
  340. }
  341. VerifyType(field, value);
  342. object list;
  343. if (!fields.TryGetValue(field, out list)) {
  344. throw new ArgumentOutOfRangeException();
  345. }
  346. ((IList<object>) list)[index] = value;
  347. }
  348. }
  349. /// <summary>
  350. /// See <see cref="IBuilder.AddRepeatedField" />
  351. /// </summary>
  352. internal void AddRepeatedField(FieldDescriptor field, object value) {
  353. if (!field.IsRepeated) {
  354. throw new ArgumentException("AddRepeatedField can only be called on repeated fields.");
  355. }
  356. VerifyType(field, value);
  357. object list;
  358. if (!fields.TryGetValue(field, out list)) {
  359. list = new List<object>();
  360. fields[field] = list;
  361. }
  362. ((IList<object>) list).Add(value);
  363. }
  364. /// <summary>
  365. /// Returns an enumerator for the field map. Used to write the fields out.
  366. /// </summary>
  367. internal IEnumerator<KeyValuePair<FieldDescriptor, object>> GetEnumerator() {
  368. return fields.GetEnumerator();
  369. }
  370. /// <summary>
  371. /// See <see cref="IMessage.IsInitialized" />
  372. /// </summary>
  373. /// <remarks>
  374. /// Since FieldSet itself does not have any way of knowing about
  375. /// required fields that aren't actually present in the set, it is up
  376. /// to the caller to check for genuinely required fields. This property
  377. /// merely checks that any messages present are themselves initialized.
  378. /// </remarks>
  379. internal bool IsInitialized {
  380. get {
  381. foreach (KeyValuePair<FieldDescriptor, object> entry in fields) {
  382. FieldDescriptor field = entry.Key;
  383. if (field.MappedType == MappedType.Message) {
  384. if (field.IsRepeated) {
  385. foreach(IMessage message in (IEnumerable) entry.Value) {
  386. if (!message.IsInitialized) {
  387. return false;
  388. }
  389. }
  390. } else {
  391. if (!((IMessage) entry.Value).IsInitialized) {
  392. return false;
  393. }
  394. }
  395. }
  396. }
  397. return true;
  398. }
  399. }
  400. /// <summary>
  401. /// Verifies whether all the required fields in the specified message
  402. /// descriptor are present in this field set, as well as whether
  403. /// all the embedded messages are themselves initialized.
  404. /// </summary>
  405. internal bool IsInitializedWithRespectTo(MessageDescriptor type) {
  406. foreach (FieldDescriptor field in type.Fields) {
  407. if (field.IsRequired && !HasField(field)) {
  408. return false;
  409. }
  410. }
  411. return IsInitialized;
  412. }
  413. /// <summary>
  414. /// See <see cref="IBuilder.ClearField" />
  415. /// </summary>
  416. public void ClearField(FieldDescriptor field) {
  417. fields.Remove(field);
  418. }
  419. /// <summary>
  420. /// See <see cref="IMessage.GetRepeatedFieldCount" />
  421. /// </summary>
  422. public int GetRepeatedFieldCount(FieldDescriptor field) {
  423. if (!field.IsRepeated) {
  424. throw new ArgumentException("GetRepeatedFieldCount() can only be called on repeated fields.");
  425. }
  426. return ((IList<object>) this[field]).Count;
  427. }
  428. /// <summary>
  429. /// Implementation of both <c>MergeFrom</c> methods.
  430. /// </summary>
  431. /// <param name="otherFields"></param>
  432. private void MergeFields(IEnumerable<KeyValuePair<FieldDescriptor, object>> otherFields) {
  433. // Note: We don't attempt to verify that other's fields have valid
  434. // types. Doing so would be a losing battle. We'd have to verify
  435. // all sub-messages as well, and we'd have to make copies of all of
  436. // them to insure that they don't change after verification (since
  437. // the IMessage interface itself cannot enforce immutability of
  438. // implementations).
  439. // TODO(jonskeet): Provide a function somewhere called MakeDeepCopy()
  440. // which allows people to make secure deep copies of messages.
  441. foreach (KeyValuePair<FieldDescriptor, object> entry in otherFields) {
  442. FieldDescriptor field = entry.Key;
  443. object existingValue;
  444. fields.TryGetValue(field, out existingValue);
  445. if (field.IsRepeated) {
  446. if (existingValue == null) {
  447. existingValue = new List<object>();
  448. fields[field] = existingValue;
  449. }
  450. IList<object> list = (IList<object>) existingValue;
  451. foreach (object otherValue in (IEnumerable) entry.Value) {
  452. list.Add(otherValue);
  453. }
  454. } else if (field.MappedType == MappedType.Message && existingValue != null) {
  455. IMessage existingMessage = (IMessage)existingValue;
  456. IMessage merged = existingMessage.CreateBuilderForType()
  457. .MergeFrom(existingMessage)
  458. .MergeFrom((IMessage)entry.Value)
  459. .Build();
  460. this[field] = merged;
  461. } else {
  462. this[field] = entry.Value;
  463. }
  464. }
  465. }
  466. /// <summary>
  467. /// See <see cref="IBuilder.MergeFrom(IMessage)" />
  468. /// </summary>
  469. public void MergeFrom(IMessage other) {
  470. MergeFields(other.AllFields);
  471. }
  472. /// <summary>
  473. /// Like <see cref="MergeFrom(IMessage)"/>, but merges from another <c>FieldSet</c>.
  474. /// </summary>
  475. public void MergeFrom(FieldSet other) {
  476. MergeFields(other.fields);
  477. }
  478. /// <summary>
  479. /// See <see cref="IMessage.WriteTo(CodedOutputStream)" />.
  480. /// </summary>
  481. public void WriteTo(CodedOutputStream output) {
  482. foreach (KeyValuePair<FieldDescriptor, object> entry in fields) {
  483. WriteField(entry.Key, entry.Value, output);
  484. }
  485. }
  486. /// <summary>
  487. /// Writes a single field to a CodedOutputStream.
  488. /// </summary>
  489. public void WriteField(FieldDescriptor field, Object value, CodedOutputStream output) {
  490. if (field.IsExtension && field.ContainingType.Options.MessageSetWireFormat) {
  491. output.WriteMessageSetExtension(field.FieldNumber, (IMessage) value);
  492. } else {
  493. if (field.IsRepeated) {
  494. foreach (object element in (IEnumerable) value) {
  495. output.WriteField(field.FieldType, field.FieldNumber, element);
  496. }
  497. } else {
  498. output.WriteField(field.FieldType, field.FieldNumber, value);
  499. }
  500. }
  501. }
  502. /// <summary>
  503. /// See <see cref="IMessage.SerializedSize" />. It's up to the caller to
  504. /// cache the resulting size if desired.
  505. /// </summary>
  506. public int SerializedSize {
  507. get {
  508. int size = 0;
  509. foreach (KeyValuePair<FieldDescriptor, object> entry in fields) {
  510. FieldDescriptor field = entry.Key;
  511. object value = entry.Value;
  512. if (field.IsExtension && field.ContainingType.Options.MessageSetWireFormat) {
  513. size += CodedOutputStream.ComputeMessageSetExtensionSize(field.FieldNumber, (IMessage) value);
  514. } else {
  515. if (field.IsRepeated) {
  516. foreach (object element in (IEnumerable) value) {
  517. size += CodedOutputStream.ComputeFieldSize(field.FieldType, field.FieldNumber, element);
  518. }
  519. } else {
  520. size += CodedOutputStream.ComputeFieldSize(field.FieldType, field.FieldNumber, value);
  521. }
  522. }
  523. }
  524. return size;
  525. }
  526. }
  527. /// <summary>
  528. /// Verifies that the given object is of the correct type to be a valid
  529. /// value for the given field.
  530. /// </summary>
  531. /// <remarks>
  532. /// For repeated fields, this checks if the object is of the right
  533. /// element type, not whether it's a list.
  534. /// </remarks>
  535. /// <exception cref="ArgumentException">The value is not of the right type.</exception>
  536. private static void VerifyType(FieldDescriptor field, object value) {
  537. bool isValid = false;
  538. switch (field.MappedType) {
  539. case MappedType.Int32: isValid = value is int; break;
  540. case MappedType.Int64: isValid = value is long; break;
  541. case MappedType.UInt32: isValid = value is uint; break;
  542. case MappedType.UInt64: isValid = value is ulong; break;
  543. case MappedType.Single: isValid = value is float; break;
  544. case MappedType.Double: isValid = value is double; break;
  545. case MappedType.Boolean: isValid = value is bool; break;
  546. case MappedType.String: isValid = value is string; break;
  547. case MappedType.ByteString: isValid = value is ByteString; break;
  548. case MappedType.Enum:
  549. EnumValueDescriptor enumValue = value as EnumValueDescriptor;
  550. isValid = enumValue != null && enumValue.EnumDescriptor == field.EnumType;
  551. break;
  552. case MappedType.Message:
  553. IMessage messageValue = value as IMessage;
  554. isValid = messageValue != null && messageValue.DescriptorForType == field.MessageType;
  555. break;
  556. }
  557. if (!isValid) {
  558. // When chaining calls to SetField(), it can be hard to tell from
  559. // the stack trace which exact call failed, since the whole chain is
  560. // considered one line of code. So, let's make sure to include the
  561. // field name and other useful info in the exception.
  562. throw new ArgumentException("Wrong object type used with protocol message reflection. "
  563. + "Message type \"" + field.ContainingType.FullName
  564. + "\", field \"" + (field.IsExtension ? field.FullName : field.Name)
  565. + "\", value was type \"" + value.GetType().Name + "\".");
  566. }
  567. }
  568. }
  569. }