Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / Threading / DispatcherExceptionEventArgs.cs / 1305600 / DispatcherExceptionEventArgs.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: Arguments for the events that convey an exception that was // raised while executing code via the Dispatcher. // // History: // 07/22/2003 : KenLai - Created // 05/25/2005 : WeibZ - Rename it // //--------------------------------------------------------------------------- using System.Diagnostics; using System; namespace System.Windows.Threading { ////// Arguments for the events that convey an exception that was raised /// while executing code via the dispatcher. /// public sealed class DispatcherUnhandledExceptionEventArgs : DispatcherEventArgs { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- // Initialize a new event argument. internal DispatcherUnhandledExceptionEventArgs(Dispatcher dispatcher) : base(dispatcher) { } //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- ////// The exception that was raised while executing code via the /// dispatcher. /// public Exception Exception { get { return _exception; } } ////// Whether or not the exception event has been handled. /// Other handlers should respect this field, and not display any /// UI in response to being notified. Passive responses (such as /// logging) can still be done. /// If no handler sets this value to true, default UI will be shown. /// public bool Handled { get { return _handled; } set { // Only allow to be set true. if (value == true) { _handled = value; } } } //------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ ////// Initialize the preallocated args class for use. /// ////// This method MUST NOT FAIL because it is called from an exception /// handler: do not do any heavy lifting or allocate more memory. /// This initialization step is separated from the constructor /// precisely because we wanted to preallocate the memory and avoid /// hitting a secondary exception in the out-of-memory case. /// /// /// The exception that was raised while executing code via the /// dispatcher /// /// /// Whether or not the exception has been handled /// internal void Initialize(Exception exception, bool handled) { Debug.Assert(exception != null); _exception = exception; _handled = handled; } //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ private Exception _exception; private bool _handled; } ////// Delegate for the events that convey the state of the UiConext /// in response to various actions that involve items. /// public delegate void DispatcherUnhandledExceptionEventHandler(object sender, DispatcherUnhandledExceptionEventArgs e); } // 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
- NameTable.cs
- RequestTimeoutManager.cs
- XmlRawWriterWrapper.cs
- ClientSideProviderDescription.cs
- DataControlFieldCollection.cs
- PropertyTabAttribute.cs
- SuppressMergeCheckAttribute.cs
- LambdaCompiler.Expressions.cs
- BulletChrome.cs
- BridgeDataRecord.cs
- XmlDataSourceView.cs
- XmlIgnoreAttribute.cs
- TextSearch.cs
- TextEndOfLine.cs
- ToolboxComponentsCreatedEventArgs.cs
- ToolStripLocationCancelEventArgs.cs
- NullableFloatMinMaxAggregationOperator.cs
- Bits.cs
- GradientStopCollection.cs
- CapabilitiesSection.cs
- ClientScriptManager.cs
- VersionUtil.cs
- EntryWrittenEventArgs.cs
- DataGridHyperlinkColumn.cs
- DataGridViewSelectedCellCollection.cs
- FilterException.cs
- WindowPattern.cs
- MobileUserControl.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- ContainerVisual.cs
- TransactedBatchContext.cs
- MsmqChannelFactoryBase.cs
- AdjustableArrowCap.cs
- SiteMapNodeCollection.cs
- CounterSampleCalculator.cs
- ConfigurationValidatorAttribute.cs
- FormViewModeEventArgs.cs
- EdmComplexPropertyAttribute.cs
- RepeatBehavior.cs
- HealthMonitoringSection.cs
- StylusShape.cs
- PropertyInfoSet.cs
- JsonFormatWriterGenerator.cs
- MsmqHostedTransportConfiguration.cs
- DataColumnPropertyDescriptor.cs
- TableLayoutPanel.cs
- WebControl.cs
- BindingListCollectionView.cs
- InvalidPipelineStoreException.cs
- XmlCharCheckingWriter.cs
- InputLangChangeRequestEvent.cs
- PackagePartCollection.cs
- LinkedResourceCollection.cs
- AuthStoreRoleProvider.cs
- CancellationTokenRegistration.cs
- ExplicitDiscriminatorMap.cs
- ActivityTypeResolver.xaml.cs
- CollectionChangeEventArgs.cs
- CharEntityEncoderFallback.cs
- Setter.cs
- SrgsRuleRef.cs
- CodeChecksumPragma.cs
- SchemaTableOptionalColumn.cs
- SimpleType.cs
- ComponentResourceKeyConverter.cs
- ReversePositionQuery.cs
- BitmapMetadata.cs
- Vector3DIndependentAnimationStorage.cs
- SecurityResources.cs
- HttpPostProtocolImporter.cs
- ValueSerializer.cs
- ToolStripHighContrastRenderer.cs
- CapacityStreamGeometryContext.cs
- SoundPlayerAction.cs
- WindowsScrollBarBits.cs
- SQLInt32.cs
- RequestValidator.cs
- LiteralDesigner.cs
- SmtpTransport.cs
- RowCache.cs
- MethodRental.cs
- ThousandthOfEmRealPoints.cs
- FileLogRecord.cs
- TripleDESCryptoServiceProvider.cs
- TimelineGroup.cs
- ResourcesChangeInfo.cs
- HttpGetProtocolImporter.cs
- Matrix.cs
- WinEventTracker.cs
- HttpDictionary.cs
- printdlgexmarshaler.cs
- PersistenceParticipant.cs
- NullRuntimeConfig.cs
- ResourceManagerWrapper.cs
- TextSpanModifier.cs
- StringInfo.cs
- loginstatus.cs
- InfoCardTrace.cs
- UidManager.cs
- _UriTypeConverter.cs