2002-12-24 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
[mono.git] / mcs / class / System.XML / System.Xml / XmlCharacterData.cs
index 75d188d91f06e4c50bbee0bec0727d6f78f2c23f..a9fc7d267a6c9617a444f665d177d0eff8aa77d5 100644 (file)
@@ -34,13 +34,22 @@ namespace System.Xml
                public virtual string Data {
                        get { return data; }
                        
-                       set { data = value; }
+                       set {
+                               OwnerDocument.onNodeChanging (this, this.ParentNode);
+
+                               if (IsReadOnly)
+                                       throw new ArgumentException ("Node is read-only.");
+
+                               data = value;
+
+                               OwnerDocument.onNodeChanged (this, this.ParentNode);
+                       }
                }
 
                public override string InnerText {
                        get { return data; }
 
-                       set { data = value; }
+                       set { Data = value; }   // invokes events
                }
 
                public virtual int Length {
@@ -51,14 +60,7 @@ namespace System.Xml
                        get { return data; }
 
                        set {
-                               OwnerDocument.onNodeChanging (this, this.ParentNode);
-
-                               if (IsReadOnly)
-                                       throw new ArgumentException ("Node is read-only.");
-
-                               data = value;
-
-                               OwnerDocument.onNodeChanged (this, this.ParentNode);
+                               Data = value;
                        }
                }