S
Sally
I want to write a custom control that allows inner tags. Something like:
<test:Blob>
<test:ElementBase/>
<test:Element1/>
<test:Element2/>
<test:Element1/>
</test:Blob>
Since Element1 and Element2 are derived from ElementBase, I would
like to only have to have one property in my Blob Class. This does
not seem to be the case. But if I derive a new TableCell class
from TableCell, Table understands my new class without any changes.
How can do I do this for my class?
namespace test
{
public class Blob : WebControl
{
private void AddIt(Element e)
{
// do something here
}
public ElementBase Element {set{AddIt(value);}}
// shouldn't need each of these, but complains without them
public Element1 Element1 {set {AddIt(value);}}
public Element2 Element1 {set {AddIt(value);}}
}
public class ElementBase
{}
public class Element1 : ElementBase
{}
public class Element2 : ElementBase
{}
}
<test:Blob>
<test:ElementBase/>
<test:Element1/>
<test:Element2/>
<test:Element1/>
</test:Blob>
Since Element1 and Element2 are derived from ElementBase, I would
like to only have to have one property in my Blob Class. This does
not seem to be the case. But if I derive a new TableCell class
from TableCell, Table understands my new class without any changes.
How can do I do this for my class?
namespace test
{
public class Blob : WebControl
{
private void AddIt(Element e)
{
// do something here
}
public ElementBase Element {set{AddIt(value);}}
// shouldn't need each of these, but complains without them
public Element1 Element1 {set {AddIt(value);}}
public Element2 Element1 {set {AddIt(value);}}
}
public class ElementBase
{}
public class Element1 : ElementBase
{}
public class Element2 : ElementBase
{}
}