XmlReflectionMember.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //
  2. // System.Xml.Serialization.XmlReflectionMember
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. namespace System.Xml.Serialization {
  10. public class XmlReflectionMember {
  11. #region Fields
  12. bool isReturnValue;
  13. string memberName;
  14. Type memberType;
  15. bool overrideIsNullable;
  16. SoapAttributes soapAttributes;
  17. XmlAttributes xmlAttributes;
  18. #endregion
  19. #region Constructors
  20. public XmlReflectionMember ()
  21. {
  22. }
  23. internal XmlReflectionMember (string name, Type type, XmlAttributes attributes)
  24. {
  25. memberName = name;
  26. memberType = type;
  27. xmlAttributes = attributes;
  28. }
  29. internal XmlReflectionMember (string name, Type type, SoapAttributes attributes)
  30. {
  31. memberName = name;
  32. memberType = type;
  33. soapAttributes = attributes;
  34. }
  35. #endregion // Constructors
  36. #region Properties
  37. public bool IsReturnValue {
  38. get { return isReturnValue; }
  39. set { isReturnValue = value; }
  40. }
  41. public string MemberName {
  42. get { return memberName; }
  43. set { memberName = value; }
  44. }
  45. public Type MemberType {
  46. get { return memberType; }
  47. set { memberType = value; }
  48. }
  49. public bool OverrideIsNullable {
  50. get { return overrideIsNullable; }
  51. set { overrideIsNullable = value; }
  52. }
  53. public SoapAttributes SoapAttributes {
  54. get {
  55. if (soapAttributes == null) soapAttributes = new SoapAttributes();
  56. return soapAttributes;
  57. }
  58. set { soapAttributes = value; }
  59. }
  60. public XmlAttributes XmlAttributes {
  61. get {
  62. if (xmlAttributes == null) xmlAttributes = new XmlAttributes();
  63. return xmlAttributes;
  64. }
  65. set { xmlAttributes = value; }
  66. }
  67. internal bool InternalEquals (XmlReflectionMember other)
  68. {
  69. if (other == null) return false;
  70. if (isReturnValue != other.isReturnValue) return false;
  71. if (memberName != other.memberName) return false;
  72. if (memberType != other.memberType) return false;
  73. if (overrideIsNullable != other.overrideIsNullable) return false;
  74. if (soapAttributes == null) {
  75. if (other.soapAttributes != null) return false; }
  76. else
  77. if (!soapAttributes.InternalEquals (other.soapAttributes)) return false;
  78. if (xmlAttributes == null) {
  79. if (other.xmlAttributes != null) return false; }
  80. else
  81. if (!xmlAttributes.InternalEquals (other.xmlAttributes)) return false;
  82. return true;
  83. }
  84. #endregion // Properties
  85. }
  86. }