Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / AsyncCompletedEventArgs.cs / 1305376 / AsyncCompletedEventArgs.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel { using System.Diagnostics.CodeAnalysis; using System.Security.Permissions; using System.Reflection; [HostProtection(SharedState = true)] public class AsyncCompletedEventArgs : System.EventArgs { private readonly Exception error; private readonly bool cancelled; private readonly object userState; public AsyncCompletedEventArgs(Exception error, bool cancelled, object userState) { this.error = error; this.cancelled = cancelled; this.userState = userState; } [ SRDescription(SR.Async_AsyncEventArgs_Cancelled) ] public bool Cancelled { get { return cancelled; } } [ SRDescription(SR.Async_AsyncEventArgs_Error) ] public Exception Error { get { return error; } } [ SRDescription(SR.Async_AsyncEventArgs_UserState) ] public object UserState { get { return userState; } } // Call from every result 'getter'. Will throw if there's an error or operation was cancelled // [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] protected void RaiseExceptionIfNecessary() { if (Error != null) { throw new TargetInvocationException(SR.GetString(SR.Async_ExceptionOccurred), Error); } else if (Cancelled) { throw new InvalidOperationException(SR.GetString(SR.Async_OperationCancelled)); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MailAddress.cs
- StdValidatorsAndConverters.cs
- _OSSOCK.cs
- BaseInfoTable.cs
- EntityDesignerDataSourceView.cs
- FtpRequestCacheValidator.cs
- GridErrorDlg.cs
- DefaultSection.cs
- QilPatternFactory.cs
- TemplateBuilder.cs
- InkPresenter.cs
- _SpnDictionary.cs
- WeakEventManager.cs
- RenderData.cs
- Listbox.cs
- InheritablePropertyChangeInfo.cs
- ConsumerConnectionPoint.cs
- Int64KeyFrameCollection.cs
- DataGridViewTextBoxColumn.cs
- CodeIndexerExpression.cs
- HostProtectionException.cs
- HtmlProps.cs
- AudioFormatConverter.cs
- Binding.cs
- FullTextBreakpoint.cs
- EventLogEntry.cs
- DBSqlParserTableCollection.cs
- BasePattern.cs
- Avt.cs
- LightweightCodeGenerator.cs
- XmlSchemaDatatype.cs
- ResourceReferenceExpression.cs
- HttpCookie.cs
- StructuredCompositeActivityDesigner.cs
- ActivityStateQuery.cs
- Win32.cs
- TypeBuilder.cs
- CopyOfAction.cs
- TimeManager.cs
- SqlDataSourceConfigureSelectPanel.cs
- GacUtil.cs
- AuthenticationException.cs
- MailSettingsSection.cs
- CookieProtection.cs
- ResourceAssociationSet.cs
- DesignerValidatorAdapter.cs
- LookupNode.cs
- XmlSignificantWhitespace.cs
- InternalConfigEventArgs.cs
- SubqueryTrackingVisitor.cs
- CommandDevice.cs
- DesignerHost.cs
- CharEntityEncoderFallback.cs
- Random.cs
- PermissionListSet.cs
- TextTreeExtractElementUndoUnit.cs
- StyleSheet.cs
- DecoderBestFitFallback.cs
- RIPEMD160.cs
- DesignerVerbCollection.cs
- Interlocked.cs
- RetriableClipboard.cs
- DataGridToolTip.cs
- DrawingCollection.cs
- DrawTreeNodeEventArgs.cs
- userdatakeys.cs
- LifetimeServices.cs
- _SSPIWrapper.cs
- PathGradientBrush.cs
- FormConverter.cs
- ProtectedConfigurationProviderCollection.cs
- TableCell.cs
- WebPartTracker.cs
- EditorPartCollection.cs
- MeasurementDCInfo.cs
- KnownTypeDataContractResolver.cs
- SQLDateTimeStorage.cs
- EventBuilder.cs
- DataColumnMappingCollection.cs
- SafeHandle.cs
- SafeEventLogWriteHandle.cs
- Operator.cs
- DataGridViewSelectedRowCollection.cs
- CachedRequestParams.cs
- QilNode.cs
- BitmapEffectvisualstate.cs
- IFlowDocumentViewer.cs
- Exceptions.cs
- VirtualDirectoryMapping.cs
- MasterPageParser.cs
- TextShapeableCharacters.cs
- CallContext.cs
- HierarchicalDataTemplate.cs
- URLAttribute.cs
- log.cs
- ProfileService.cs
- DetailsViewRow.cs
- Page.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- ActivitySurrogate.cs