Is this possible without venturing into unmanned code land? Would this hypothetical method still work If I wanted a reference to a reference of a delegate instead of cows?
namespace ContrivedExample
{
class cow
{
int Weight;
public cow(int i) { Weight = i; }
public void HowMuchWeight()
{
Console.WriteLine(Weight);
}
}
public class program
{
static void Main()
{
cow RefCow;
cow Cow1 = new cow(5);
cow Cow2 = new cow(10);
cow ReftoRefCow;
RefCow = Cow1;
ReftoRefCow = RefCow;
ReftoRefCow.HowMuchWeight(); // Prints 5 as it should
RefCow = Cow2;
ReftoRefCow.HowMuchWeight(); //Still prints 5. I want to somehow make it say 10
}
}
}