Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / System / Windows / Threading / DispatcherExceptionEventArgs.cs / 1 / 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 : [....] - Created // 05/25/2005 : [....] - 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
- SqlError.cs
- BounceEase.cs
- DataObjectCopyingEventArgs.cs
- ConstraintCollection.cs
- New.cs
- TextWriter.cs
- ClickablePoint.cs
- BindingNavigator.cs
- ThemeableAttribute.cs
- PeerUnsafeNativeCryptMethods.cs
- LastQueryOperator.cs
- DemultiplexingClientMessageFormatter.cs
- NumericUpDownAccelerationCollection.cs
- ContentFilePart.cs
- TypeGeneratedEventArgs.cs
- XhtmlStyleClass.cs
- ValueTypeFixupInfo.cs
- BinaryObjectInfo.cs
- Deflater.cs
- GridItemPatternIdentifiers.cs
- KeyFrames.cs
- SettingsAttributes.cs
- TextTreeInsertElementUndoUnit.cs
- OletxCommittableTransaction.cs
- CommandPlan.cs
- PeerNeighborManager.cs
- ResourceWriter.cs
- ActivityPreviewDesigner.cs
- XsltConvert.cs
- SqlOuterApplyReducer.cs
- SqlGatherProducedAliases.cs
- XmlSchemaAppInfo.cs
- IdentityVerifier.cs
- IsolatedStorageFile.cs
- TraceListeners.cs
- ActivityDelegate.cs
- Margins.cs
- UIElementPropertyUndoUnit.cs
- WindowsSpinner.cs
- DesignerForm.cs
- DataConnectionHelper.cs
- ToolStripSystemRenderer.cs
- EventProviderBase.cs
- Win32KeyboardDevice.cs
- BehaviorEditorPart.cs
- XmlArrayItemAttribute.cs
- ResetableIterator.cs
- SelectingProviderEventArgs.cs
- KeyTimeConverter.cs
- DesignerProperties.cs
- RunInstallerAttribute.cs
- EmptyCollection.cs
- LambdaCompiler.Address.cs
- ScrollViewerAutomationPeer.cs
- XmlTextAttribute.cs
- entitydatasourceentitysetnameconverter.cs
- TemplateBamlRecordReader.cs
- XmlKeywords.cs
- BindingList.cs
- InlineCollection.cs
- XpsFilter.cs
- HandlerFactoryCache.cs
- NetworkCredential.cs
- XmlSchemaComplexContent.cs
- MessageDecoder.cs
- PersonalizationState.cs
- GlyphsSerializer.cs
- OdbcConnectionStringbuilder.cs
- SimpleType.cs
- ResourcePermissionBase.cs
- GradientStopCollection.cs
- PropertyDescriptor.cs
- X509SecurityTokenProvider.cs
- HyperlinkAutomationPeer.cs
- MemberAccessException.cs
- COM2ColorConverter.cs
- ISO2022Encoding.cs
- ErrorLog.cs
- DataGridViewCheckBoxColumn.cs
- ClientTarget.cs
- Registration.cs
- DbConnectionFactory.cs
- EntityContainer.cs
- CallContext.cs
- EmbeddedObject.cs
- PeerNearMe.cs
- Camera.cs
- PersonalizationStateInfoCollection.cs
- ListBindableAttribute.cs
- OutputWindow.cs
- SqlRowUpdatingEvent.cs
- _TLSstream.cs
- MaskPropertyEditor.cs
- InvalidDataContractException.cs
- TypeDependencyAttribute.cs
- NativeMethods.cs
- ObjectCloneHelper.cs
- Graph.cs
- XmlDictionaryWriter.cs
- TimeManager.cs