Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ParentQuery.cs
- TrackingStringDictionary.cs
- XmlIgnoreAttribute.cs
- ConditionalAttribute.cs
- CalendarDayButton.cs
- BooleanKeyFrameCollection.cs
- DocumentReferenceCollection.cs
- DataKey.cs
- TypeExtensions.cs
- WorkflowDataContext.cs
- VolatileEnlistmentMultiplexing.cs
- TemplateAction.cs
- MobileUITypeEditor.cs
- RuntimeHandles.cs
- Size3DValueSerializer.cs
- OraclePermission.cs
- CompleteWizardStep.cs
- SecurityKeyType.cs
- PolicyManager.cs
- ClickablePoint.cs
- DataErrorValidationRule.cs
- FormsAuthenticationTicket.cs
- Number.cs
- ProviderCollection.cs
- arabicshape.cs
- OleDbWrapper.cs
- unsafenativemethodsother.cs
- RectangleConverter.cs
- PersistenceTypeAttribute.cs
- Transform3DGroup.cs
- XmlComplianceUtil.cs
- DataBindingCollection.cs
- ByteAnimation.cs
- DataGridViewRowsAddedEventArgs.cs
- HMACRIPEMD160.cs
- RangeBase.cs
- EntityDataSourceEntitySetNameItem.cs
- CachedPathData.cs
- GridViewCellAutomationPeer.cs
- BindingBase.cs
- Binding.cs
- HostProtectionException.cs
- Int16.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- PerCallInstanceContextProvider.cs
- Frame.cs
- OleDbFactory.cs
- RelOps.cs
- LinqDataSourceStatusEventArgs.cs
- PageContentAsyncResult.cs
- LookupNode.cs
- WindowsToolbar.cs
- DbParameterHelper.cs
- UserPreferenceChangedEventArgs.cs
- _FixedSizeReader.cs
- PreservationFileReader.cs
- EventProviderBase.cs
- SegmentInfo.cs
- InputProviderSite.cs
- ContainerSelectorBehavior.cs
- TextBoxView.cs
- DependencyObjectType.cs
- DocumentGridContextMenu.cs
- LineServices.cs
- ConfigurationManager.cs
- AssertSection.cs
- ObjectDataSourceDisposingEventArgs.cs
- ProcessingInstructionAction.cs
- EntityContainer.cs
- WebEventCodes.cs
- HtmlProps.cs
- _ShellExpression.cs
- SystemThemeKey.cs
- MemoryFailPoint.cs
- DiagnosticStrings.cs
- TransactionState.cs
- RemotingConfigParser.cs
- StorageEntityContainerMapping.cs
- CacheHelper.cs
- MenuRendererClassic.cs
- JsonGlobals.cs
- ControlTemplate.cs
- ConfigurationLockCollection.cs
- ActivitiesCollection.cs
- PageThemeBuildProvider.cs
- Registry.cs
- PersianCalendar.cs
- OleDbConnectionFactory.cs
- AuthenticationSchemesHelper.cs
- LongValidator.cs
- Filter.cs
- ContentTypeSettingDispatchMessageFormatter.cs
- securitymgrsite.cs
- SafeEventLogWriteHandle.cs
- ReadWriteObjectLock.cs
- FormattedText.cs
- SerializationBinder.cs
- SqlGenericUtil.cs
- Bitmap.cs
- PrinterUnitConvert.cs