System.Threading.CompressedStackSwitcher.UndoNoThrow C# (CSharp) Method

UndoNoThrow() private method

private UndoNoThrow ( ) : bool
return bool
        internal bool UndoNoThrow()
        {
            try
            {
                Undo();
            }
            catch
            {
                return false;
            }
            return true;
        }

Usage Example

        [HandleProcessCorruptedStateExceptions] //
#endif // FEATURE_CORRUPTING_EXCEPTIONS
        internal static CompressedStackSwitcher SetCompressedStack(CompressedStack cs, CompressedStack prevCS)
        {
            CompressedStackSwitcher cssw = new CompressedStackSwitcher();

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                // Order is important in this block.
                // Also, we dont want any THreadAborts happening when we try to set it
                RuntimeHelpers.PrepareConstrainedRegions();
                try
                {
                    // Empty try block to ensure no ThreadAborts in the finally block
                }
                finally
                {
                    // SetCompressedStackThread can throw - only if it suceeds we shd update the switcher and overrides
                    SetCompressedStackThread(cs);
                    cssw.prev_CS      = prevCS;
                    cssw.curr_CS      = cs;
                    cssw.prev_ADStack = SetAppDomainStack(cs);
                }
            }
            catch
            {
                cssw.UndoNoThrow();
                throw; // throw the original exception
            }
            return(cssw);
        }
All Usage Examples Of System.Threading.CompressedStackSwitcher::UndoNoThrow