public void Init() { _container = new MethodContainer(); _delegate = (Action<MethodContainer>) typeof (MethodContainer).GetMethod("MethodCall").CreateDelegate(typeof (Action<MethodContainer>)); }
public void Init() { var methodInfo = typeof (MethodContainer).GetMethod("MethodCall"); var containerExpr = Expression.Parameter(typeof (MethodContainer), "container"); var invokeExpr = Expression.Call(containerExpr, methodInfo); var lambda = Expression.Lambda<Action<MethodContainer>>(invokeExpr, containerExpr); _compiled = lambda.Compile(); _container = new MethodContainer(); }
public void Init() { _container = new MethodContainer(); }
public void Init() { _container = new MethodContainer(); _type = typeof (MethodContainer); }