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
- _BaseOverlappedAsyncResult.cs
- Int32Storage.cs
- PageParserFilter.cs
- SimpleApplicationHost.cs
- MobileControlBuilder.cs
- TaskDesigner.cs
- OleDbFactory.cs
- CollectionViewGroup.cs
- PKCS1MaskGenerationMethod.cs
- UTF32Encoding.cs
- SmtpReplyReader.cs
- TextBoxBase.cs
- SystemTcpStatistics.cs
- ToolStripSplitButton.cs
- FindCriteriaCD1.cs
- CustomLineCap.cs
- filewebrequest.cs
- XmlReaderDelegator.cs
- TraceInternal.cs
- HttpApplicationStateBase.cs
- InputBuffer.cs
- HelpKeywordAttribute.cs
- LineServices.cs
- Constant.cs
- IntSecurity.cs
- Image.cs
- AbstractDataSvcMapFileLoader.cs
- ApplicationId.cs
- Input.cs
- TextEditorCopyPaste.cs
- TextViewBase.cs
- NativeMethods.cs
- ClientScriptManager.cs
- TraceSection.cs
- SamlDelegatingWriter.cs
- TypeCodeDomSerializer.cs
- MatcherBuilder.cs
- OracleException.cs
- ExecutionContext.cs
- HotSpotCollectionEditor.cs
- wmiprovider.cs
- FontStretches.cs
- DataProviderNameConverter.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- PageStatePersister.cs
- UInt64Converter.cs
- PeerApplication.cs
- DesignerHierarchicalDataSourceView.cs
- SelectionRange.cs
- ISessionStateStore.cs
- GridViewUpdateEventArgs.cs
- AssemblyCache.cs
- CodeSubDirectoriesCollection.cs
- Thread.cs
- CookielessHelper.cs
- ImageConverter.cs
- BeginEvent.cs
- PhysicalFontFamily.cs
- SequenceNumber.cs
- HttpCapabilitiesBase.cs
- NodeLabelEditEvent.cs
- X509ChainElement.cs
- DbModificationClause.cs
- securestring.cs
- basemetadatamappingvisitor.cs
- ListCollectionView.cs
- RegexBoyerMoore.cs
- OleDbMetaDataFactory.cs
- ConnectionPointConverter.cs
- QueryContinueDragEvent.cs
- OperatorExpressions.cs
- TextEditorSpelling.cs
- CommonDialog.cs
- BitmapEffectDrawing.cs
- MarkupExtensionParser.cs
- XmlSchemaValidator.cs
- Fonts.cs
- FixedDocument.cs
- TargetException.cs
- GridViewDeletedEventArgs.cs
- SystemColorTracker.cs
- Model3DGroup.cs
- RuntimeHandles.cs
- Cursor.cs
- ListViewCommandEventArgs.cs
- UniqueContractNameValidationBehavior.cs
- SourceChangedEventArgs.cs
- EncryptedKey.cs
- SqlMethods.cs
- ObjectDataSourceView.cs
- NaturalLanguageHyphenator.cs
- HttpHandlerAction.cs
- DocumentAutomationPeer.cs
- EntityViewGenerationAttribute.cs
- ExternalException.cs
- UnicastIPAddressInformationCollection.cs
- CollectionExtensions.cs
- RuntimeResourceSet.cs
- CodeDefaultValueExpression.cs
- FontFamilyConverter.cs