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
- TreeView.cs
- MiniLockedBorderGlyph.cs
- Ipv6Element.cs
- XPathDocument.cs
- SetterBaseCollection.cs
- externdll.cs
- StorageMappingFragment.cs
- Opcode.cs
- FontStyleConverter.cs
- UIElementParaClient.cs
- InheritanceContextHelper.cs
- DropDownList.cs
- EnumUnknown.cs
- ToolStripDropDown.cs
- StrongNameKeyPair.cs
- HttpResponse.cs
- TextParaLineResult.cs
- DesignUtil.cs
- OutputWindow.cs
- CoreSwitches.cs
- Animatable.cs
- ProxyDataContractResolver.cs
- TextRangeSerialization.cs
- MatrixTransform3D.cs
- XamlSerializationHelper.cs
- AnnotationResourceCollection.cs
- TypeElementCollection.cs
- ModuleConfigurationInfo.cs
- ipaddressinformationcollection.cs
- RtfFormatStack.cs
- TimeZone.cs
- ContentTextAutomationPeer.cs
- ResponseStream.cs
- COAUTHINFO.cs
- ADRoleFactoryConfiguration.cs
- basemetadatamappingvisitor.cs
- DebugView.cs
- AuthenticationManager.cs
- BitmapData.cs
- TemplatedAdorner.cs
- TemplateComponentConnector.cs
- UrlAuthFailedErrorFormatter.cs
- CustomAssemblyResolver.cs
- UniqueIdentifierService.cs
- Matrix3D.cs
- FormClosedEvent.cs
- FlowDocumentReader.cs
- ObjectParameterCollection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- InkCollectionBehavior.cs
- TagMapInfo.cs
- GcSettings.cs
- RawAppCommandInputReport.cs
- SelectionProviderWrapper.cs
- ExceptionRoutedEventArgs.cs
- DiscoveryUtility.cs
- AuthenticationManager.cs
- FirewallWrapper.cs
- WebPartConnectionsConnectVerb.cs
- SqlDataSourceCommandEventArgs.cs
- StrongNamePublicKeyBlob.cs
- CustomErrorsSectionWrapper.cs
- IisTraceListener.cs
- DataGridViewColumnConverter.cs
- GZipUtils.cs
- ObjectStateManagerMetadata.cs
- DisplayInformation.cs
- LineInfo.cs
- Double.cs
- log.cs
- ButtonFieldBase.cs
- TextRangeEdit.cs
- OracleTimeSpan.cs
- TransformationRules.cs
- DateTimeParse.cs
- CodeCompiler.cs
- TypeNameHelper.cs
- InstanceStoreQueryResult.cs
- _LocalDataStore.cs
- wgx_exports.cs
- TabletCollection.cs
- TableItemStyle.cs
- CodeTryCatchFinallyStatement.cs
- TypeUsage.cs
- SamlAssertion.cs
- SpecialFolderEnumConverter.cs
- ErasingStroke.cs
- DynamicResourceExtensionConverter.cs
- HttpPostedFileBase.cs
- PageAsyncTask.cs
- SortAction.cs
- EllipseGeometry.cs
- UInt64Converter.cs
- ActivityExecutionContextCollection.cs
- DispatcherSynchronizationContext.cs
- ServiceManager.cs
- PeerTransportBindingElement.cs
- FloatAverageAggregationOperator.cs
- ParameterCollection.cs
- AssemblyUtil.cs