Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / CriticalExceptions.cs / 1305600 / CriticalExceptions.cs
using System; #if PBTCOMPILER namespace MS.Internal.Markup #elif SYSTEM_XAML namespace System.Xaml #else using MS.Internal.WindowsBase; // FriendAccessAllowed namespace MS.Internal #endif { #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] #endif internal static class CriticalExceptions { // these are all the exceptions considered critical by PreSharp #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] #endif internal static bool IsCriticalException(Exception ex) { ex = Unwrap(ex); return ex is NullReferenceException || ex is StackOverflowException || ex is OutOfMemoryException || ex is System.Threading.ThreadAbortException || ex is System.Runtime.InteropServices.SEHException || ex is System.Security.SecurityException; } // these are exceptions that we should treat as critical when they // arise during callbacks into application code #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] internal static bool IsCriticalApplicationException(Exception ex) { ex = Unwrap(ex); return ex is StackOverflowException || ex is OutOfMemoryException || ex is System.Threading.ThreadAbortException || ex is System.Security.SecurityException; } #endif #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] #endif internal static Exception Unwrap(Exception ex) { // for certain types of exceptions, we care more about the inner // exception while (ex.InnerException != null && ( ex is System.Reflection.TargetInvocationException )) { ex = ex.InnerException; } return ex; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; #if PBTCOMPILER namespace MS.Internal.Markup #elif SYSTEM_XAML namespace System.Xaml #else using MS.Internal.WindowsBase; // FriendAccessAllowed namespace MS.Internal #endif { #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] #endif internal static class CriticalExceptions { // these are all the exceptions considered critical by PreSharp #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] #endif internal static bool IsCriticalException(Exception ex) { ex = Unwrap(ex); return ex is NullReferenceException || ex is StackOverflowException || ex is OutOfMemoryException || ex is System.Threading.ThreadAbortException || ex is System.Runtime.InteropServices.SEHException || ex is System.Security.SecurityException; } // these are exceptions that we should treat as critical when they // arise during callbacks into application code #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] internal static bool IsCriticalApplicationException(Exception ex) { ex = Unwrap(ex); return ex is StackOverflowException || ex is OutOfMemoryException || ex is System.Threading.ThreadAbortException || ex is System.Security.SecurityException; } #endif #if !PBTCOMPILER && !SYSTEM_XAML [FriendAccessAllowed] #endif internal static Exception Unwrap(Exception ex) { // for certain types of exceptions, we care more about the inner // exception while (ex.InnerException != null && ( ex is System.Reflection.TargetInvocationException )) { ex = ex.InnerException; } return ex; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlDataProvider.cs
- LogWriteRestartAreaState.cs
- OleDbPropertySetGuid.cs
- RawStylusInputReport.cs
- XsltContext.cs
- ValueSerializer.cs
- IndicFontClient.cs
- RuleProcessor.cs
- CharacterBufferReference.cs
- CounterCreationData.cs
- SerialPort.cs
- _IPv4Address.cs
- InfoCardArgumentException.cs
- TextRangeProviderWrapper.cs
- JapaneseLunisolarCalendar.cs
- FileSystemWatcher.cs
- XmlQueryStaticData.cs
- MasterPageBuildProvider.cs
- ConsoleCancelEventArgs.cs
- ElementNotAvailableException.cs
- SectionRecord.cs
- OrderedDictionary.cs
- WebEventCodes.cs
- StreamUpdate.cs
- CaseInsensitiveComparer.cs
- DataRow.cs
- PathData.cs
- DispatcherHookEventArgs.cs
- ImpersonateTokenRef.cs
- MultiBindingExpression.cs
- X509ThumbprintKeyIdentifierClause.cs
- TemplateKeyConverter.cs
- CompilerResults.cs
- CodeArrayCreateExpression.cs
- PipelineModuleStepContainer.cs
- FontTypeConverter.cs
- StretchValidation.cs
- TreeNodeCollection.cs
- oledbconnectionstring.cs
- KeyInstance.cs
- AnnotationStore.cs
- DataKey.cs
- HitTestFilterBehavior.cs
- SetterBaseCollection.cs
- ToolBarButton.cs
- SqlReorderer.cs
- EnlistmentState.cs
- Closure.cs
- DispatcherFrame.cs
- DelegateTypeInfo.cs
- SmiXetterAccessMap.cs
- TraceContextRecord.cs
- LicenseManager.cs
- ProcessInfo.cs
- XamlInt32CollectionSerializer.cs
- SqlReferenceCollection.cs
- OdbcDataReader.cs
- SecurityTokenTypes.cs
- DNS.cs
- IncrementalReadDecoders.cs
- ByeMessageApril2005.cs
- EntityCommandDefinition.cs
- CopyAction.cs
- MapPathBasedVirtualPathProvider.cs
- cookie.cs
- RegexCharClass.cs
- Package.cs
- DefaultAssemblyResolver.cs
- HotSpot.cs
- SecurityPolicySection.cs
- StateMachineDesignerPaint.cs
- SharedConnectionInfo.cs
- SignatureConfirmations.cs
- DataGridViewRowPostPaintEventArgs.cs
- DocumentApplicationJournalEntry.cs
- Annotation.cs
- FastEncoderWindow.cs
- TextLineResult.cs
- AstNode.cs
- ComponentResourceKey.cs
- DataServiceContext.cs
- WindowsAuthenticationEventArgs.cs
- SpellerError.cs
- Descriptor.cs
- TdsParser.cs
- PtsHost.cs
- CultureInfoConverter.cs
- ProxyWebPartManagerDesigner.cs
- ValueTypeFixupInfo.cs
- ToolBarOverflowPanel.cs
- BindValidator.cs
- KeyboardNavigation.cs
- SqlBuffer.cs
- HtmlImage.cs
- _emptywebproxy.cs
- ChtmlLinkAdapter.cs
- InkCanvasAutomationPeer.cs
- ComboBoxItem.cs
- XPathCompileException.cs
- SortableBindingList.cs