[System.Security.SecurityCritical]  // auto-generated
        static internal void runTryCode(Object userData)
        {
            CompressedStackRunData rData = (CompressedStackRunData)userData;

            rData.cssw = SetCompressedStack(rData.cs, GetCompressedStackThread());
            rData.callBack(rData.state);
        }
        internal static void runTryCode(object userData)
        {
            CompressedStackRunData data = (CompressedStackRunData)userData;

            data.cssw = SetCompressedStack(data.cs, GetCompressedStackThread());
            data.callBack(data.state);
        }
        public static void Run(CompressedStack compressedStack, ContextCallback callback, object state)
        {
            if (compressedStack == null)
            {
                throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamNull"), "compressedStack");
            }
            if (cleanupCode == null)
            {
                tryCode     = new RuntimeHelpers.TryCode(CompressedStack.runTryCode);
                cleanupCode = new RuntimeHelpers.CleanupCode(CompressedStack.runFinallyCode);
            }
            CompressedStackRunData userData = new CompressedStackRunData(compressedStack, callback, state);

            RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(tryCode, cleanupCode, userData);
        }
        static internal void runFinallyCode(Object userData, bool exceptionThrown)
        {
            CompressedStackRunData rData = (CompressedStackRunData)userData;

            rData.cssw.Undo();
        }
Пример #5
0
 public static void Run(CompressedStack compressedStack, ContextCallback callback, Object state)
 {
     
     if (compressedStack == null )
     {
         throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamNull"),"compressedStack");
     }
     Contract.EndContractBlock();
     if (cleanupCode == null)
     {
         tryCode = new RuntimeHelpers.TryCode(runTryCode);
         cleanupCode = new RuntimeHelpers.CleanupCode(runFinallyCode);
     }
     
     CompressedStackRunData runData = new CompressedStackRunData(compressedStack, callback, state);
     RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(tryCode, cleanupCode, runData);
 }