lundi 17 août 2015

Inheritance in c# using reflection

I am in a situation where i have to inherit a class and access its protected method to get a value.

Due to some weird situations i have most of my code in reflection and i m hoping if i have any chance to get this working using reflection.

To make things more clear,

Below is the class

public class Converter: BaseConverter
{
    public Converter();
    protected override object StringToValue();
}

I need to do below to get the functionality working.

public class myclass:Converter
{
 public StringToValue()
  {
    base.StringToVaue();
  }
}

I cannot use direct references in my project . So i am handicapped here to use inheritance and add :Converter to my class . So how can i approach this using reflection which would be to basically make this class inherit the base class at runtime .





Aucun commentaire:

Enregistrer un commentaire