SoapAttributeAttribute.cs 1.2 KB

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