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
- DescendantBaseQuery.cs
- Color.cs
- InputBuffer.cs
- UnmanagedMemoryAccessor.cs
- HiddenFieldPageStatePersister.cs
- ChangeDirector.cs
- GlyphInfoList.cs
- handlecollector.cs
- SynchronizedDispatch.cs
- PolyLineSegment.cs
- RegisteredDisposeScript.cs
- RemoteTokenFactory.cs
- RawKeyboardInputReport.cs
- SplitterDesigner.cs
- TriggerBase.cs
- TextEditorSpelling.cs
- ToolStripGrip.cs
- TabletDevice.cs
- XmlReturnReader.cs
- Monitor.cs
- TabControl.cs
- PolicyStatement.cs
- FileChangesMonitor.cs
- MultipartContentParser.cs
- LayoutEditorPart.cs
- PropertyEntry.cs
- XsdBuilder.cs
- Control.cs
- FontStyle.cs
- RichTextBoxContextMenu.cs
- URLIdentityPermission.cs
- SizeAnimationUsingKeyFrames.cs
- ThemeDirectoryCompiler.cs
- RuleInfoComparer.cs
- MatchAttribute.cs
- backend.cs
- WSSecurityXXX2005.cs
- LookupBindingPropertiesAttribute.cs
- ButtonStandardAdapter.cs
- CheckBoxPopupAdapter.cs
- XmlWhitespace.cs
- LinqDataSourceDisposeEventArgs.cs
- JapaneseCalendar.cs
- PropertyPushdownHelper.cs
- CertificateReferenceElement.cs
- ClientTarget.cs
- WorkItem.cs
- DifferencingCollection.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- UriParserTemplates.cs
- CompoundFileReference.cs
- TextServicesCompartment.cs
- LogArchiveSnapshot.cs
- PageContentCollection.cs
- TagElement.cs
- WebServiceClientProxyGenerator.cs
- ExceptionWrapper.cs
- RelOps.cs
- Attributes.cs
- HtmlImage.cs
- TextTrailingWordEllipsis.cs
- InplaceBitmapMetadataWriter.cs
- AssociationSet.cs
- invalidudtexception.cs
- ConfigXmlText.cs
- UpDownBase.cs
- ModuleBuilder.cs
- AsyncMethodInvoker.cs
- TransactionInformation.cs
- StorageAssociationTypeMapping.cs
- Vector.cs
- XPathNavigatorException.cs
- Exception.cs
- WebColorConverter.cs
- TranslateTransform3D.cs
- HttpListenerResponse.cs
- CodeExpressionStatement.cs
- TextContainer.cs
- Ref.cs
- FragmentNavigationEventArgs.cs
- WindowsComboBox.cs
- DecoratedNameAttribute.cs
- ColorConvertedBitmapExtension.cs
- CompilationLock.cs
- ListViewContainer.cs
- Timer.cs
- ProcessModelInfo.cs
- ToolboxComponentsCreatedEventArgs.cs
- HelpKeywordAttribute.cs
- StateMachineWorkflowDesigner.cs
- RequiredFieldValidator.cs
- TitleStyle.cs
- OleDbException.cs
- RoleManagerModule.cs
- SendParametersContent.cs
- QilBinary.cs
- StringPropertyBuilder.cs
- SignerInfo.cs
- CannotUnloadAppDomainException.cs
- SelectionListComponentEditor.cs