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
- FileEnumerator.cs
- HtmlInputHidden.cs
- WebPartEditVerb.cs
- ShaperBuffers.cs
- LogSwitch.cs
- FormsAuthentication.cs
- InProcStateClientManager.cs
- SiteMapNodeItemEventArgs.cs
- DSACryptoServiceProvider.cs
- BatchWriter.cs
- DataGridViewRowsRemovedEventArgs.cs
- CodeMemberMethod.cs
- HashMembershipCondition.cs
- VSWCFServiceContractGenerator.cs
- SizeAnimation.cs
- Message.cs
- EncodingStreamWrapper.cs
- EntityCollectionChangedParams.cs
- PackageRelationshipSelector.cs
- GifBitmapEncoder.cs
- ExceptionUtil.cs
- Query.cs
- ChangePasswordDesigner.cs
- ConfigurationConverterBase.cs
- XmlnsDictionary.cs
- EnumerableRowCollection.cs
- ChunkedMemoryStream.cs
- wmiprovider.cs
- ListItemParagraph.cs
- unsafenativemethodstextservices.cs
- Base64Decoder.cs
- PolyBezierSegmentFigureLogic.cs
- base64Transforms.cs
- SimplePropertyEntry.cs
- CollectionContainer.cs
- PagesChangedEventArgs.cs
- ColumnPropertiesGroup.cs
- ObjectDataSourceStatusEventArgs.cs
- JavaScriptString.cs
- ScrollBarAutomationPeer.cs
- BamlBinaryReader.cs
- ToolStripMenuItem.cs
- templategroup.cs
- XmlDocumentType.cs
- GeneralTransform3D.cs
- ServiceOperationParameter.cs
- ErrorProvider.cs
- CharacterString.cs
- Point3DAnimation.cs
- SupportsEventValidationAttribute.cs
- PerfCounters.cs
- DataGridViewRowPrePaintEventArgs.cs
- FieldMetadata.cs
- HandoffBehavior.cs
- TargetParameterCountException.cs
- OdbcParameter.cs
- WindowsToolbarAsMenu.cs
- DataGridViewMethods.cs
- XmlHierarchicalEnumerable.cs
- __Error.cs
- SchemaTableColumn.cs
- AtomPub10CategoriesDocumentFormatter.cs
- EventMappingSettings.cs
- OrderPreservingSpoolingTask.cs
- AsyncResult.cs
- MethodBuilder.cs
- ProfilePropertySettings.cs
- URIFormatException.cs
- RtfToXamlLexer.cs
- BinaryWriter.cs
- DataGridViewCellCancelEventArgs.cs
- XmlCharCheckingReader.cs
- ProxyGenerationError.cs
- StoreContentChangedEventArgs.cs
- WebPartEditVerb.cs
- DatatypeImplementation.cs
- Part.cs
- XmlSchemaInferenceException.cs
- ControlLocalizer.cs
- XsltFunctions.cs
- AutomationProperty.cs
- ProfileParameter.cs
- XsltArgumentList.cs
- Content.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- PropertyManager.cs
- TypeSystem.cs
- CultureMapper.cs
- MarshalDirectiveException.cs
- TextSelectionHighlightLayer.cs
- GPStream.cs
- ResourceDefaultValueAttribute.cs
- WebPartDescriptionCollection.cs
- TraceSource.cs
- PartManifestEntry.cs
- TextTreeText.cs
- CodeBinaryOperatorExpression.cs
- DependencyPropertyAttribute.cs
- BinaryParser.cs
- BinaryObjectReader.cs