public object[] EndCall(object service, WcfExtendedAsyncResult asyncResult)
        {
            var endParameters = new object[_endMethodTypes.Length];

            endParameters[endParameters.Length - 1] = asyncResult.OrgAsyncResult;

            _endMethod.Invoke(service, endParameters);

            var result = new object[_endMethodTypes.Length - 1];

            Array.Copy(endParameters, 0, result, 0, _endMethodTypes.Length - 1);

            return(result);
        }
Exemple #2
0
        protected override IExtendedAsyncResult <TRes> ProcessBeginCall <TRes>(
            MethodInvocationParams mip, Action <IExtendedAsyncResult <TRes> > callBack, object userState)
        {
            var asyncMethods = _getAsyncMethods(mip.Method);

            var callResult = new WcfExtendedAsyncResult <TRes>(_service, callBack, asyncMethods.EndCall);

            // obserwacja: jeśli poleci callback, to będzie miał oryginalne iasyncresult => nie potrzebujemy więc go w WcfExtendedAsyncResult w takim przypadku - tłumacz może go nam wyprodukować!
            // obserwacja: potrzebujemy gotowe WcfExtendedAsyncResult tylko gdy wychodziny stąd! czyli możemy to gówno ustawić przy wychodzeniu!
            // todo: straszna to wioska jest, ale cóż....
            callResult.OrgAsyncResult = asyncMethods.BeginCall(
                _service,
                mip.Arguments,
                WrapSynchonizationContextIfNeeded(callResult.FireOnInternalWcfCallCompleted),
                userState);

            return(callResult);
        }