XmlTextAttribute.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // XmlTextAttribute.cs:
  3. //
  4. // Author:
  5. // John Donagher ([email protected])
  6. //
  7. // (C) 2002 John Donagher
  8. //
  9. using System;
  10. namespace System.Xml.Serialization
  11. {
  12. /// <summary>
  13. /// Summary description for XmlTextAttribute.
  14. /// </summary>
  15. [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
  16. | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
  17. public class XmlTextAttribute : Attribute
  18. {
  19. private string dataType = "";
  20. private Type type;
  21. public XmlTextAttribute ()
  22. {
  23. }
  24. public XmlTextAttribute (Type type)
  25. {
  26. Type = type;
  27. }
  28. public string DataType {
  29. get {
  30. return dataType;
  31. }
  32. set {
  33. dataType = value;
  34. }
  35. }
  36. public Type Type
  37. {
  38. get {
  39. return type;
  40. }
  41. set {
  42. type = value;
  43. }
  44. }
  45. internal void AddKeyHash (System.Text.StringBuilder sb)
  46. {
  47. sb.Append ("XTXA ");
  48. KeyHelper.AddField (sb, 1, type);
  49. KeyHelper.AddField (sb, 2, dataType);
  50. sb.Append ('|');
  51. }
  52. }
  53. }