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
- BindingContext.cs
- ColorAnimation.cs
- ApplicationContext.cs
- ContextMenuService.cs
- Scene3D.cs
- Span.cs
- DataGridViewRowHeaderCell.cs
- DataGridViewSortCompareEventArgs.cs
- IntPtr.cs
- TypeValidationEventArgs.cs
- XmlUTF8TextWriter.cs
- MultilineStringConverter.cs
- ShapingWorkspace.cs
- NamespaceQuery.cs
- PathFigureCollection.cs
- Span.cs
- DtdParser.cs
- ListCollectionView.cs
- shaperfactory.cs
- SessionIDManager.cs
- DockProviderWrapper.cs
- DrawingVisual.cs
- AttachedAnnotationChangedEventArgs.cs
- DataGridViewControlCollection.cs
- AttachmentService.cs
- TextRangeProviderWrapper.cs
- SharedStatics.cs
- BodyWriter.cs
- PrintDialog.cs
- DrawingServices.cs
- ListViewGroup.cs
- LinqToSqlWrapper.cs
- SmiTypedGetterSetter.cs
- CustomErrorCollection.cs
- SymmetricAlgorithm.cs
- XhtmlConformanceSection.cs
- BindableAttribute.cs
- ResourceManagerWrapper.cs
- InheritanceContextHelper.cs
- FileReservationCollection.cs
- TrackingServices.cs
- AppDomainUnloadedException.cs
- StringUtil.cs
- SqlIdentifier.cs
- QilGenerator.cs
- TdsParserHelperClasses.cs
- WorkflowInlining.cs
- ApplicationSecurityManager.cs
- ImageCodecInfoPrivate.cs
- ParameterInfo.cs
- AssemblyName.cs
- GetKeyedHashRequest.cs
- Padding.cs
- InvalidComObjectException.cs
- InProcStateClientManager.cs
- Opcode.cs
- MSAAEventDispatcher.cs
- CultureTableRecord.cs
- CacheEntry.cs
- MemoryMappedFile.cs
- FormView.cs
- SystemIPv6InterfaceProperties.cs
- CrossContextChannel.cs
- ConfigurationElement.cs
- WindowsFormsSectionHandler.cs
- RawMouseInputReport.cs
- HttpFormatExtensions.cs
- WindowsSolidBrush.cs
- DuplicateWaitObjectException.cs
- ServiceManager.cs
- EntityContainerEntitySetDefiningQuery.cs
- PageThemeBuildProvider.cs
- ControlAdapter.cs
- TraceHelpers.cs
- UInt16.cs
- ExchangeUtilities.cs
- Material.cs
- AudioDeviceOut.cs
- TaskFormBase.cs
- CompressEmulationStream.cs
- ResizeBehavior.cs
- StorageMappingItemCollection.cs
- XmlSchemaAppInfo.cs
- RestHandler.cs
- DataGridViewCellParsingEventArgs.cs
- PeerNameResolver.cs
- RowVisual.cs
- UidManager.cs
- XmlStringTable.cs
- SourceFileInfo.cs
- Error.cs
- ValuePatternIdentifiers.cs
- BrowserCapabilitiesFactoryBase.cs
- LongSumAggregationOperator.cs
- Control.cs
- ObjectDataSourceDisposingEventArgs.cs
- CodeSubDirectory.cs
- DoubleAnimation.cs
- NonClientArea.cs
- dbenumerator.cs