Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / 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 : 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. //---------------------------------------------------------------------------- // //// 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
- TransportConfigurationTypeElementCollection.cs
- XmlNamespaceMapping.cs
- WpfSharedXamlSchemaContext.cs
- SqlInternalConnectionTds.cs
- Activation.cs
- SettingsBase.cs
- HtmlShim.cs
- PeerTransportListenAddressValidator.cs
- EntityConnectionStringBuilder.cs
- SmtpDigestAuthenticationModule.cs
- NameGenerator.cs
- ClientBuildManagerCallback.cs
- Overlapped.cs
- GridViewCommandEventArgs.cs
- safex509handles.cs
- CursorInteropHelper.cs
- SemaphoreSecurity.cs
- MenuEventArgs.cs
- SerializationSectionGroup.cs
- DeclarativeCatalogPart.cs
- OleDbPropertySetGuid.cs
- Variable.cs
- CompilerParameters.cs
- httpapplicationstate.cs
- CategoriesDocumentFormatter.cs
- BoolExpr.cs
- XmlSchemaExporter.cs
- PointIndependentAnimationStorage.cs
- ServicePointManager.cs
- ValidationRuleCollection.cs
- Timer.cs
- XmlSerializerVersionAttribute.cs
- IISUnsafeMethods.cs
- sqlstateclientmanager.cs
- WebHeaderCollection.cs
- MenuItemStyle.cs
- ProvidersHelper.cs
- BufferModeSettings.cs
- ProcessHostMapPath.cs
- LinqDataSourceEditData.cs
- contentDescriptor.cs
- TemplatedWizardStep.cs
- MultiBindingExpression.cs
- BrowserTree.cs
- WindowsBrush.cs
- MetafileHeaderWmf.cs
- HtmlFormWrapper.cs
- BindingElementExtensionElement.cs
- HtmlInputImage.cs
- unsafeIndexingFilterStream.cs
- Panel.cs
- KeyInfo.cs
- SectionUpdates.cs
- SortQueryOperator.cs
- SchemaEntity.cs
- DataServiceRequestOfT.cs
- OlePropertyStructs.cs
- base64Transforms.cs
- PrimaryKeyTypeConverter.cs
- DecoderReplacementFallback.cs
- CapabilitiesPattern.cs
- ProtectedConfigurationSection.cs
- Application.cs
- ContentPlaceHolder.cs
- JpegBitmapEncoder.cs
- MarkedHighlightComponent.cs
- XmlSchemaIdentityConstraint.cs
- DataRowChangeEvent.cs
- CellParagraph.cs
- PageContentCollection.cs
- TableItemPattern.cs
- ExpressionBuilderContext.cs
- HtmlShim.cs
- DependencyObject.cs
- DecimalStorage.cs
- FileDialogCustomPlacesCollection.cs
- VersionedStream.cs
- RecordManager.cs
- FocusChangedEventArgs.cs
- AppDomain.cs
- CompModSwitches.cs
- AlternateView.cs
- Vector3D.cs
- InputLanguage.cs
- InkPresenter.cs
- WebPartConnectionCollection.cs
- RectAnimationClockResource.cs
- MD5CryptoServiceProvider.cs
- HttpChannelFactory.cs
- TransformedBitmap.cs
- StateDesigner.LayoutSelectionGlyph.cs
- GACMembershipCondition.cs
- _UriSyntax.cs
- LockingPersistenceProvider.cs
- MenuBindingsEditorForm.cs
- MimeBasePart.cs
- XmlNodeChangedEventArgs.cs
- DataGridItemEventArgs.cs
- NameNode.cs
- ManipulationStartedEventArgs.cs