2
0

SoapAttributes.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // SoapAttributes.cs:
  3. //
  4. // Author:
  5. // John Donagher ([email protected])
  6. //
  7. // (C) 2002 John Donagher
  8. //
  9. using System.Reflection;
  10. using System;
  11. using System.ComponentModel;
  12. namespace System.Xml.Serialization
  13. {
  14. /// <summary>
  15. /// Summary description for SoapAttributes.
  16. /// </summary>
  17. public class SoapAttributes
  18. {
  19. private SoapAttributeAttribute soapAttribute;
  20. private object soapDefaultValue;
  21. private SoapElementAttribute soapElement;
  22. private SoapEnumAttribute soapEnum;
  23. private bool soapIgnore;
  24. private SoapTypeAttribute soapType;
  25. public SoapAttributes ()
  26. {
  27. }
  28. public SoapAttributes (ICustomAttributeProvider provider)
  29. {
  30. object[] attributes = provider.GetCustomAttributes(false);
  31. foreach(object obj in attributes)
  32. {
  33. if(obj is SoapAttributeAttribute)
  34. soapAttribute = (SoapAttributeAttribute) obj;
  35. else if(obj is DefaultValueAttribute)
  36. soapDefaultValue = obj;
  37. else if(obj is SoapElementAttribute)
  38. soapElement = (SoapElementAttribute) obj;
  39. else if(obj is SoapEnumAttribute)
  40. soapEnum = (SoapEnumAttribute) obj;
  41. else if(obj is SoapIgnoreAttribute)
  42. soapIgnore = true;
  43. else if(obj is SoapTypeAttribute)
  44. soapType = (SoapTypeAttribute) obj;
  45. }
  46. }
  47. public SoapAttributeAttribute SoapAttribute
  48. {
  49. get { return soapAttribute; }
  50. set { soapAttribute = value; }
  51. }
  52. public object SoapDefaultValue
  53. {
  54. get { return soapDefaultValue; }
  55. set { soapDefaultValue = value; }
  56. }
  57. public SoapElementAttribute SoapElement
  58. {
  59. get { return soapElement; }
  60. set { soapElement = value; }
  61. }
  62. public SoapEnumAttribute SoapEnum
  63. {
  64. get { return soapEnum; }
  65. set { soapEnum = value; }
  66. }
  67. public bool SoapIgnore
  68. {
  69. get { return soapIgnore; }
  70. set { soapIgnore = value; }
  71. }
  72. public SoapTypeAttribute SoapType
  73. {
  74. get { return soapType; }
  75. set { soapType = value; }
  76. }
  77. }
  78. }