Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- CollectionViewGroupRoot.cs
- DesignerSerializationVisibilityAttribute.cs
- ImportRequest.cs
- SerTrace.cs
- ScrollContentPresenter.cs
- XPathEmptyIterator.cs
- CollectionView.cs
- XmlLangPropertyAttribute.cs
- SettingsBindableAttribute.cs
- DbModificationClause.cs
- PropertyDescriptorGridEntry.cs
- _NativeSSPI.cs
- ConstrainedGroup.cs
- ClientTargetSection.cs
- TableCellAutomationPeer.cs
- MaterialCollection.cs
- WebBrowserUriTypeConverter.cs
- CommandConverter.cs
- IPAddressCollection.cs
- TimeIntervalCollection.cs
- WeakHashtable.cs
- RoutedEventArgs.cs
- ScrollBar.cs
- XPathItem.cs
- LinkedResource.cs
- XmlWriterSettings.cs
- MsmqTransportBindingElement.cs
- TableCellCollection.cs
- TraceListeners.cs
- AutomationPropertyInfo.cs
- HostedImpersonationContext.cs
- ResourcesBuildProvider.cs
- OutputCacheModule.cs
- PeerCollaborationPermission.cs
- LifetimeServices.cs
- Automation.cs
- DirectoryObjectSecurity.cs
- CookieParameter.cs
- DataSourceNameHandler.cs
- HttpApplicationStateWrapper.cs
- PageCodeDomTreeGenerator.cs
- RepeatButton.cs
- TraceInternal.cs
- VerificationAttribute.cs
- TreeNodeStyle.cs
- ObjectQuery_EntitySqlExtensions.cs
- StaticFileHandler.cs
- MenuBase.cs
- _HeaderInfo.cs
- TransformerTypeCollection.cs
- StateRuntime.cs
- InstanceHandleConflictException.cs
- TextProperties.cs
- EntitySet.cs
- LazyTextWriterCreator.cs
- StackOverflowException.cs
- ProfileSection.cs
- OleAutBinder.cs
- ValidationEventArgs.cs
- ManifestResourceInfo.cs
- ConfigXmlComment.cs
- XPathNavigatorReader.cs
- LifetimeServices.cs
- Set.cs
- Closure.cs
- EncodingNLS.cs
- DataGridViewToolTip.cs
- DesignerImageAdapter.cs
- Double.cs
- DateTimeConverter2.cs
- ExpressionBindings.cs
- ClientFormsIdentity.cs
- SQLInt32.cs
- NamespaceEmitter.cs
- XmlSchemaAll.cs
- ProxyFragment.cs
- OTFRasterizer.cs
- precedingsibling.cs
- TemplateKeyConverter.cs
- COSERVERINFO.cs
- ExecutionContext.cs
- AsmxEndpointPickerExtension.cs
- EditorZone.cs
- UserValidatedEventArgs.cs
- DataSourceCacheDurationConverter.cs
- ListViewItemMouseHoverEvent.cs
- MappingModelBuildProvider.cs
- DependentList.cs
- ListenUriMode.cs
- PropertyEntry.cs
- CannotUnloadAppDomainException.cs
- ConfigurationLockCollection.cs
- UpdatePanelTrigger.cs
- ServiceReflector.cs
- NaturalLanguageHyphenator.cs
- XmlDesignerDataSourceView.cs
- DetailsViewModeEventArgs.cs
- TextEvent.cs
- ColumnResult.cs
- EdmProviderManifest.cs