Here is what I want to do:
public [type determined at runtime] ImageToShow
{
get
{
if(this.IsWebContext)
{
return this.GetString();
}
else
{
return this.GetBitmap();
}
}
}
At first look it seems simple and doable if T was the generic type which with instance of this class was created. But what I want to do is serve a String or Bitmap based on determination made within the Image property so that the knowledge of what to server as Image is contained within the Image property and no place else needs to know about it. I can certainly make the return type 'object' and it will work, but I don't want boxing and unboxing inefficiency neither do I want reflection involved.
I just wanted to check with you guys if this is possible before I give up on this idea.