Ok, this takes a bit of setup first.
public interface IPolicyObjectAdapter
{
PolicyImage GetPolicyImage(BridgePolicy policy);
}
public class BridgePolicyAdapter : IPolicyObjectAdapter
{
protected virtual PolicyImage GetPolicyImage(BridgePolicy policy)
{
AddPolicyInformation(policy);
}
protected virtual void AddPolicyInformation(BridgePolicy policy)
{
//does stuff
}
}
public class HSPolicyAdapter : BridgePolicyAdapter, IPolicyObjectAdapter
{
protected override void AddPolicyInformation(BridgePolicy policy)
{
base.AddPolicyInformation(policy);
//does more stuff
}
}
When I execute the following code, I expect the code to enter into the HSPolicyAdapter’s AddPolicyInformation method. But it never does. It just goes straight into the BridgePolicyAdapters AddPolicyInformation method.
IPolicyObjectAdapter Adapter = null;
Adapter = new HSPolicyAdapter();
PolicyImage image = Adapter.GetPolicyImage(policy);
I am sure I am missing something so obvious it will hurt, but my brain isnt working right now. What am I missing?
I cobbled together this interpretation and it worked fine for me: