コード例 #1
0
 public static void Run(CompressedStack compressedStack, ContextCallback callback, object state)
 {
     if (compressedStack == null)
     {
         throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamNull"), "compressedStack");
     }
     if (CompressedStack.cleanupCode == null)
     {
         CompressedStack.tryCode     = new RuntimeHelpers.TryCode(CompressedStack.runTryCode);
         CompressedStack.cleanupCode = new RuntimeHelpers.CleanupCode(CompressedStack.runFinallyCode);
     }
     CompressedStack.CompressedStackRunData compressedStackRunData = new CompressedStack.CompressedStackRunData(compressedStack, callback, state);
     RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(CompressedStack.tryCode, CompressedStack.cleanupCode, (object)compressedStackRunData);
 }
コード例 #2
0
 internal static void runTryCode(object userData)
 {
     CompressedStack.CompressedStackRunData compressedStackRunData = (CompressedStack.CompressedStackRunData)userData;
     compressedStackRunData.cssw = CompressedStack.SetCompressedStack(compressedStackRunData.cs, CompressedStack.GetCompressedStackThread());
     compressedStackRunData.callBack(compressedStackRunData.state);
 }
コード例 #3
0
 internal static void runFinallyCode(object userData, bool exceptionThrown)
 {
     CompressedStack.CompressedStackRunData compressedStackRunData = (CompressedStack.CompressedStackRunData)userData;
     compressedStackRunData.cssw.Undo();
 }