From the code that you posted (which may have been pseudo code) it makes it
look like it could be a static method. I wasn't sure. I was actually
thinking that if you're using objects then this would be a classic use of
polymorphism. Or, for some reason, do you only have the name of the class as
a string?
http://msdn2.microsoft.com/en-us/lib...52(VS.80).aspx
private void button1_Click(object sender, EventArgs e)
{
DerivedClassA a = new DerivedClassA();
DerivedClassB b = new DerivedClassB();
Delete(a);
Delete(b);
}
private void Delete(BaseClass c)
{
c.Delete();
}
....
public abstract class BaseClass : System.Object
{
public virtual void Delete()
{
}
}
public class DerivedClassA : BaseClass
{
public override void Delete()
{
MessageBox.Show(this.ToString());
}
}
public class DerivedClassB : BaseClass
{
public override void Delete()
{
MessageBox.Show(this.ToString());
}
}
--
Tim Wilson
..NET Compact Framework MVP
"Jarod" <bl*****@NOSPAM.gazeta.pl> wrote in message
news:uG*************@TK2MSFTNGP10.phx.gbl...
Are you looking to call the Delete method against an object or the class
itself? In other words, is the Delete method static?
--
It can be if it makes diffrence ;) Or makes it easier ;)
Jarod