/// <summary> /// 메소드 invoker를 획득합니다. /// </summary> /// <typeparam name="T">MethodInvoker Type</typeparam> /// <param name="invokerArgs">Type에 필요한 전달 인자</param> /// <returns></returns> public T GetMethodInvoker <T>(string methodName, object[] invokerArgs = null) where T : MethodInvoker { if (methodName == null || methodName == string.Empty) { throw new ArgumentException("methodName은 nulㅣor empty값이 될 수 없습니다."); } //invokerCore를 획득후 이를 이용한 Invoker 생성 MethodInvokerCore core = _instanceImpl.GetMethodInvokerCore(methodName); object[] args = new object[3] { core, _methodInvokerCounter, invokerArgs }; T invoker = (T)Activator.CreateInstance( typeof(T), BindingFlags.Instance | BindingFlags.NonPublic, null, args, null); //InstanceProxy의 이벤트 연결 EventInvalidProxy += invoker.HandlerInstanceProxyInvalid; //InstanceProxy가 유효성이 변경 되었을때 통지할 핸들러 연결 return(invoker); }
internal TESTINVOKER(MethodInvokerCore core, RefCounter instanceRefCounter, object[] args) : base(core, instanceRefCounter, null) { OKOK = true; }
/// <summary> /// 내부 필드를 초기화하는 기본 생성자 /// </summary> private MethodInvoker() { _core = null; _instanceRefCounter = null; _isValid = false; _wasCallDispose = false; EventInvalidInvoker = null; }
/// <summary> /// MethodInvoker를 생성합니다. /// </summary> /// <param name="core">MethodCore</param> /// <param name="instanceRefCounter">InstaceProxy의 Method Counter</param> /// <param name="args">기타 변수. 기본 Invoker에서는 사용되지 않습니다.</param> internal MethodInvoker(MethodInvokerCore core, RefCounter instanceRefCounter, object[] args) : this() { if (core == null || instanceRefCounter == null) { _isValid = false; throw new ArgumentNullException("core or instanceRefCounter는 null값이 될 수 없습니다."); } //코어 _core = core; //참조 횟수 증가 _instanceRefCounter = instanceRefCounter; _instanceRefCounter.IncrementRefCounter(); //유효함 _isValid = true; }
/// <summary> /// 관리되는 리소스를 해제 합니다. /// </summary> private void ReleaseManagementResource() { _core = null; }