给出两个对象
public sealed class Master
{
Action<string> RenderDetail;
}
public sealed class Detail
{
void RenderDetail(string text) { //some stuff }
}
如果我在master上设置RenderDetail Action,就像这样:
public sealed class MasterSettings
{
private Master _MasterInstance;
private void SomeMethod()
{
DetailList detail = new DetailList();
_MasterInstance.RenderDetail = detail.RenderDetail;
}
}
它有效,但记忆含义是什么? 如果在SomeMethod调用后销毁详细列表实例,MasterInstance如何调用detail方法?
谢谢!