A
Andy
I'm making a drag and drop application, and in the *_DragDrop(...)-method I
have the following code:
private void SelectTree_DragDrop(object sender,
System.Windows.Forms.DragEventArgs e)
{
Object item = (object)e.Data.GetData(typeof(AbstractNode));
// Other code
}
My problem is that the type inside the brackets of typeof(...) is not
AbstractNode, instead the type can be a varity of types which all are
inherited from AbstractNode, i e I have a lot of node classes that all
inherits from the class AbstractNode.
How do I handle this problem? Of course, I don't want to handle every type
with some if statement.
have the following code:
private void SelectTree_DragDrop(object sender,
System.Windows.Forms.DragEventArgs e)
{
Object item = (object)e.Data.GetData(typeof(AbstractNode));
// Other code
}
My problem is that the type inside the brackets of typeof(...) is not
AbstractNode, instead the type can be a varity of types which all are
inherited from AbstractNode, i e I have a lot of node classes that all
inherits from the class AbstractNode.
How do I handle this problem? Of course, I don't want to handle every type
with some if statement.