URGENT! - Using Shawdow variables in VB.NET Classes
Posted on 2003-12-03
I created a class that wraps an XML node. The class is named Human because it is used to wrap many different person nodes in my XML document. Example:
<Approver Name="Bob" ActionDate="2003/12/03" SomethingElse="Blah Blah"/>
<Performer Name="sam" ActionDate="2003/11/03" SomethingElse="Blah Blah"/>
<Creator Name="ralph" ActionDate="2003/1/03" SomethingElse="Blah Blah"/>
I want to use the Human class but I need to change it's name. I tried the Shadow keyword in both the Human class and the higher classes, but that doesn't work, I can't set the name in the higher class without explicitly setting the name a run-time (which is sloppy).
In my project, each class is constructed such:
Shadows HumanName as String = "Approver"
Shadows HumanName as String
'Check for parent node and thisNode, create if necessary
Private Function HasNode() As Boolean
If IsNothing(pNode.GetElementsByTagName(HumanName).Item(0)) Then
thisNode = xmlALN.CreateElement(HumanName)
thisNode = pNode.GetElementsByTagName(HumanName).Item(0)
Any idea how I can do this efficiently?