R
Robin Hay
I have created a class which inherits from XmlDocument.
It works as I expected.
If I use Visual Studio, and type a <carriage return> after
"inherits XmlDocument", VS adds three method overrides.
These seem to make sense, but then the class doesn't
behave as I intended, or as it did if I typed in the data
myself. See example below.
Imports System.xml
Module Module1
Sub Main()
Dim doc1 As New SimpleInheritance
Dim doc2 As New VisualStudioInheritance
End Sub
End Module
Public Class SimpleInheritance
Inherits XmlDocument
Public Sub New()
MyBase.New()
LoadXml("<tag>text</tag>")
Console.WriteLine("SimpleInheritance: " &
OuterXml & "End of text")
End Sub
End Class
Public Class VisualStudioInheritance
Inherits XmlDocument
Public Sub New()
MyBase.New()
LoadXml("<tag>text</tag>")
Console.WriteLine("VisualStudioInheritance: " &
OuterXml & "End of text")
End Sub
Public Overrides Function CloneNode(ByVal deep As
Boolean) As System.Xml.XmlNode
End Function
Public Overrides Sub WriteContentTo(ByVal w As
System.Xml.XmlWriter)
End Sub
Public Overrides Sub WriteTo(ByVal w As
System.Xml.XmlWriter)
End Sub
End Class
I cann't see why the three methods have the effect that
they do. Sure it's obvious, but help would be
appreciated........
Thanks
Robin Hay
It works as I expected.
If I use Visual Studio, and type a <carriage return> after
"inherits XmlDocument", VS adds three method overrides.
These seem to make sense, but then the class doesn't
behave as I intended, or as it did if I typed in the data
myself. See example below.
Imports System.xml
Module Module1
Sub Main()
Dim doc1 As New SimpleInheritance
Dim doc2 As New VisualStudioInheritance
End Sub
End Module
Public Class SimpleInheritance
Inherits XmlDocument
Public Sub New()
MyBase.New()
LoadXml("<tag>text</tag>")
Console.WriteLine("SimpleInheritance: " &
OuterXml & "End of text")
End Sub
End Class
Public Class VisualStudioInheritance
Inherits XmlDocument
Public Sub New()
MyBase.New()
LoadXml("<tag>text</tag>")
Console.WriteLine("VisualStudioInheritance: " &
OuterXml & "End of text")
End Sub
Public Overrides Function CloneNode(ByVal deep As
Boolean) As System.Xml.XmlNode
End Function
Public Overrides Sub WriteContentTo(ByVal w As
System.Xml.XmlWriter)
End Sub
Public Overrides Sub WriteTo(ByVal w As
System.Xml.XmlWriter)
End Sub
End Class
I cann't see why the three methods have the effect that
they do. Sure it's obvious, but help would be
appreciated........
Thanks
Robin Hay