2002-08-16 Jason Diamond <jason@injektilo.org>
[mono.git] / mcs / class / System.XML / System.Xml / XmlEntity.cs
1 //
2 // System.Xml.XmlEntity.cs
3 //
4 // Author:
5 //      Duncan Mak  (duncan@ximian.com)
6 //
7 // (C) Ximian, Inc.
8 //
9
10 namespace System.Xml
11 {
12         public class XmlEntity : XmlNode
13         {
14                 #region Constructors
15
16                 internal XmlEntity (string name, string NDATA, string publicId, string systemId,
17                                     XmlDocument doc)
18                         : base (doc)
19                 {
20                         this.name = name;
21                         this.NDATA = NDATA;
22                         this.publicId = publicId;
23                         this.systemId = systemId;
24                         this.baseUri = doc.BaseURI;
25                 }
26
27                 #endregion
28                 
29                 #region Fields
30
31                 string name;
32                 string NDATA;
33                 string publicId;
34                 string systemId;
35                 string baseUri;
36
37                 #endregion
38
39                 #region Properties
40
41                 public override string BaseURI {
42                         get {  return baseUri; }
43                 }
44
45                 [MonoTODO]
46                 public override string InnerText {
47                         get { throw new NotImplementedException (); }
48                         set { throw new InvalidOperationException ("This operation is not supported."); }
49                 }
50
51                 public override string InnerXml {
52                         get { return String.Empty; }
53                         set { throw new InvalidOperationException ("This operation is not supported."); }
54                 }
55
56                 public override bool IsReadOnly {
57                         get { return true; } // always read-only.
58                 }
59
60                 public override string LocalName {
61                         get { return name; }
62                 }
63
64                 public override string Name {
65                         get { return name; }
66                 }
67
68                 public override XmlNodeType NodeType {
69                         get { return XmlNodeType.Entity; }
70                 }
71
72                 public string NotationName {
73                         get {
74                                 if (NDATA == null)
75                                         return null;
76                                 else
77                                         return NDATA;
78                         }
79                 }
80
81                 public override string OuterXml {
82                         get { return String.Empty; }
83                 }
84
85                 public string PublicId {
86                         get {
87                                 if (publicId == null)
88                                         return null;
89                                 else
90                                         return publicId;
91                         }
92                 }
93
94                 public string SystemId {
95                         get {
96                                 if (publicId == null)
97                                         return null;
98                                 else
99                                         return systemId;
100                         }
101                 }
102                 #endregion
103
104                 #region Methods
105
106                 public override XmlNode CloneNode (bool deep)
107                 {
108                         throw new InvalidOperationException ("This operation is not supported.");
109                 }
110
111                 public override void WriteContentTo (XmlWriter w)
112                 {
113                         // No effect.
114                 }
115
116                 public override void WriteTo (XmlWriter w)
117                 {
118                         // No effect.
119                 }
120
121                 #endregion
122         }
123 }