|
| 1 | +namespace AngleSharp.Xml.Dom |
| 2 | +{ |
| 3 | + using AngleSharp.Attributes; |
| 4 | + using AngleSharp.Dom; |
| 5 | + using System; |
| 6 | + |
| 7 | + /// <summary> |
| 8 | + /// Represents an entity node. |
| 9 | + /// </summary> |
| 10 | + [DomName("Entity")] |
| 11 | + public sealed class Entity : Node |
| 12 | + { |
| 13 | + #region Fields |
| 14 | + |
| 15 | + String _publicId; |
| 16 | + String _systemId; |
| 17 | + String _notationName; |
| 18 | + String _inputEncoding; |
| 19 | + String _xmlVersion; |
| 20 | + String _xmlEncoding; |
| 21 | + String _value; |
| 22 | + |
| 23 | + #endregion |
| 24 | + |
| 25 | + #region ctor |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// Creates a new entity node. |
| 29 | + /// </summary> |
| 30 | + internal Entity() |
| 31 | + : this(String.Empty) |
| 32 | + { |
| 33 | + } |
| 34 | + |
| 35 | + /// <summary> |
| 36 | + /// Creates a new entity node. |
| 37 | + /// </summary> |
| 38 | + internal Entity(String name) |
| 39 | + : base(null, name, NodeType.Entity) |
| 40 | + { |
| 41 | + } |
| 42 | + |
| 43 | + #endregion |
| 44 | + |
| 45 | + #region Properties |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Gets the public identiifer. |
| 49 | + /// </summary> |
| 50 | + [DomName("publicId")] |
| 51 | + public String PublicId |
| 52 | + { |
| 53 | + get { return _publicId; } |
| 54 | + } |
| 55 | + |
| 56 | + /// <summary> |
| 57 | + /// Gets the system identifier. |
| 58 | + /// </summary> |
| 59 | + [DomName("systemId")] |
| 60 | + public String SystemId |
| 61 | + { |
| 62 | + get { return _systemId; } |
| 63 | + } |
| 64 | + |
| 65 | + /// <summary> |
| 66 | + /// Gets the notation name. |
| 67 | + /// </summary> |
| 68 | + [DomName("notationName")] |
| 69 | + public String NotationName |
| 70 | + { |
| 71 | + get { return _notationName; } |
| 72 | + internal set { _notationName = value; } |
| 73 | + } |
| 74 | + |
| 75 | + /// <summary> |
| 76 | + /// Gets the used input encoding. |
| 77 | + /// </summary> |
| 78 | + [DomName("inputEncoding")] |
| 79 | + public String InputEncoding |
| 80 | + { |
| 81 | + get { return _inputEncoding; } |
| 82 | + } |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// Gets the used XML encoding. |
| 86 | + /// </summary> |
| 87 | + [DomName("xmlEncoding")] |
| 88 | + public String XmlEncoding |
| 89 | + { |
| 90 | + get { return _xmlEncoding; } |
| 91 | + } |
| 92 | + |
| 93 | + /// <summary> |
| 94 | + /// Gets the used XML version. |
| 95 | + /// </summary> |
| 96 | + [DomName("xmlVersion")] |
| 97 | + public String XmlVersion |
| 98 | + { |
| 99 | + get { return _xmlVersion; } |
| 100 | + } |
| 101 | + |
| 102 | + /// <summary> |
| 103 | + /// Gets or sets the entity's value. |
| 104 | + /// </summary> |
| 105 | + [DomName("textContent")] |
| 106 | + public override String TextContent |
| 107 | + { |
| 108 | + get { return NodeValue; } |
| 109 | + set { NodeValue = value; } |
| 110 | + } |
| 111 | + |
| 112 | + /// <summary> |
| 113 | + /// Gets or sets the value of the entity. |
| 114 | + /// </summary> |
| 115 | + [DomName("nodeValue")] |
| 116 | + public override String NodeValue |
| 117 | + { |
| 118 | + get { return _value; } |
| 119 | + set { _value = value; } |
| 120 | + } |
| 121 | + |
| 122 | + #endregion |
| 123 | + |
| 124 | + #region Methods |
| 125 | + |
| 126 | + /// <summary> |
| 127 | + /// Returns a duplicate of the node on which this method was called. |
| 128 | + /// </summary> |
| 129 | + public override Node Clone(Document newOwner, Boolean deep) |
| 130 | + { |
| 131 | + var node = new Entity(); |
| 132 | + CloneNode(node, newOwner, deep); |
| 133 | + node._xmlEncoding = this._xmlEncoding; |
| 134 | + node._xmlVersion = this._xmlVersion; |
| 135 | + node._systemId = this._systemId; |
| 136 | + node._publicId = this._publicId; |
| 137 | + node._inputEncoding = this._inputEncoding; |
| 138 | + node._notationName = this._notationName; |
| 139 | + return node; |
| 140 | + } |
| 141 | + |
| 142 | + #endregion |
| 143 | + } |
| 144 | +} |
0 commit comments