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
- TimerElapsedEvenArgs.cs
- PDBReader.cs
- TextSelectionHelper.cs
- CFGGrammar.cs
- PageContentAsyncResult.cs
- XmlSchemaFacet.cs
- PaginationProgressEventArgs.cs
- PathSegmentCollection.cs
- WebPartMinimizeVerb.cs
- CDSCollectionETWBCLProvider.cs
- ADConnectionHelper.cs
- StyleXamlParser.cs
- PrtCap_Reader.cs
- CodeComment.cs
- AbstractDataSvcMapFileLoader.cs
- TakeOrSkipWhileQueryOperator.cs
- TaskHelper.cs
- RoleManagerModule.cs
- MetadataHelper.cs
- TokenDescriptor.cs
- VirtualPathUtility.cs
- StringAnimationBase.cs
- TlsnegoTokenAuthenticator.cs
- ServicePointManager.cs
- NameSpaceExtractor.cs
- RtfControlWordInfo.cs
- DbExpressionRules.cs
- ListSourceHelper.cs
- ContextQuery.cs
- AlphaSortedEnumConverter.cs
- XmlSchemaObject.cs
- UnsafeNativeMethodsPenimc.cs
- Task.cs
- sqlstateclientmanager.cs
- ConfigurationSectionGroup.cs
- HttpTransportBindingElement.cs
- ValueQuery.cs
- documentsequencetextview.cs
- WebPartConnectVerb.cs
- BitmapEffectOutputConnector.cs
- TreeNodeClickEventArgs.cs
- RegexNode.cs
- DefaultTextStore.cs
- ConstructorArgumentAttribute.cs
- DbProviderServices.cs
- StringFreezingAttribute.cs
- TextProperties.cs
- WebServiceReceive.cs
- PlainXmlDeserializer.cs
- ImagingCache.cs
- Stacktrace.cs
- FreezableOperations.cs
- RegexParser.cs
- SchemaManager.cs
- HostingEnvironmentException.cs
- MarkupCompilePass1.cs
- X509ServiceCertificateAuthenticationElement.cs
- MetafileHeader.cs
- OrderByQueryOptionExpression.cs
- XmlSchemaInferenceException.cs
- RegexTree.cs
- CacheAxisQuery.cs
- WebPartManager.cs
- SoapIncludeAttribute.cs
- VisualState.cs
- SourceChangedEventArgs.cs
- Menu.cs
- TextRangeProviderWrapper.cs
- GridViewUpdateEventArgs.cs
- SaveFileDialog.cs
- GridViewUpdateEventArgs.cs
- ConfigurationCollectionAttribute.cs
- OleDbError.cs
- DataGrid.cs
- ConstantSlot.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- LinkDescriptor.cs
- SchemaElementLookUpTable.cs
- DbgCompiler.cs
- BitmapImage.cs
- DriveInfo.cs
- XD.cs
- XomlCompilerError.cs
- ColorContext.cs
- CookieProtection.cs
- ConfigurationManagerHelper.cs
- ScrollContentPresenter.cs
- MultiPropertyDescriptorGridEntry.cs
- FilterRepeater.cs
- DefaultWorkflowTransactionService.cs
- PageParserFilter.cs
- CaseInsensitiveComparer.cs
- SkipStoryboardToFill.cs
- SplitterEvent.cs
- ListDictionaryInternal.cs
- DetailsViewUpdateEventArgs.cs
- Constraint.cs
- MULTI_QI.cs
- HttpFileCollectionWrapper.cs
- SimpleTypeResolver.cs