Example #1
0
        private static Action CreateNewAction(Action call)
        {
            return(delegate
            {
                IDexterCall dexterCall = DexterContainer.Resolve <IDexterCall>();

                dexterCall.StartSession();

                try
                {
                    call.Invoke();
                    dexterCall.Complete(true);
                }
                catch
                {
                    dexterCall.Complete(false);
                    throw;
                }
            });
        }
Example #2
0
        private static Func <T> CreateNewFunc <T>(Func <T> call)
        {
            return(delegate
            {
                IDexterCall dexterCall = DexterContainer.Resolve <IDexterCall>();

                dexterCall.StartSession();

                try
                {
                    T returnObject = call.Invoke();
                    dexterCall.Complete(true);

                    return returnObject;
                }
                catch
                {
                    dexterCall.Complete(false);
                    throw;
                }
            });
        }