XmlAnyElementAttribute.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // filename.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 XmlAnyElementAttribute.
  14. /// </summary>
  15. ///
  16. [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
  17. | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple=true)]
  18. public class XmlAnyElementAttribute : Attribute
  19. {
  20. private string elementName;
  21. private string ns;
  22. public XmlAnyElementAttribute ()
  23. {
  24. }
  25. public XmlAnyElementAttribute (string name)
  26. {
  27. elementName = name;
  28. }
  29. public XmlAnyElementAttribute (string name, string ns)
  30. {
  31. elementName = name;
  32. Namespace = ns;
  33. }
  34. public string Name {
  35. get {
  36. return elementName;
  37. }
  38. set {
  39. elementName = value;
  40. }
  41. }
  42. public string Namespace {
  43. get {
  44. return ns;
  45. }
  46. set {
  47. ns = value;
  48. }
  49. }
  50. internal bool InternalEquals (XmlAnyElementAttribute other)
  51. {
  52. if (other == null) return false;
  53. return (elementName == other.elementName && ns == other.ns);
  54. }
  55. }
  56. }