Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / ComponentModel / AsyncCompletedEventArgs.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientRuntimeConfig.cs
- UmAlQuraCalendar.cs
- Converter.cs
- HttpGetProtocolImporter.cs
- SingleKeyFrameCollection.cs
- RadioButtonList.cs
- XmlTextAttribute.cs
- CodeCommentStatementCollection.cs
- NativeMethods.cs
- MergablePropertyAttribute.cs
- SingleResultAttribute.cs
- DataSysAttribute.cs
- LineGeometry.cs
- UserControlBuildProvider.cs
- RectangleGeometry.cs
- BinaryUtilClasses.cs
- FontNamesConverter.cs
- _ListenerAsyncResult.cs
- TextDecorationLocationValidation.cs
- MetadataItem.cs
- VectorAnimation.cs
- ConnectionStringSettings.cs
- WebPartManagerInternals.cs
- PageAsyncTask.cs
- MouseEvent.cs
- DataGridViewComboBoxEditingControl.cs
- CodeAttributeArgument.cs
- AmbiguousMatchException.cs
- StrokeNodeEnumerator.cs
- Point4D.cs
- FlowLayoutSettings.cs
- DataGridComboBoxColumn.cs
- SafeViewOfFileHandle.cs
- XPathItem.cs
- ProfileGroupSettingsCollection.cs
- TraceLog.cs
- MachineKeyConverter.cs
- UnsafeNativeMethodsMilCoreApi.cs
- LineProperties.cs
- SignHashRequest.cs
- TreeNodeCollection.cs
- ButtonRenderer.cs
- AppDomainProtocolHandler.cs
- RijndaelManagedTransform.cs
- ReadOnlyCollectionBase.cs
- ManualResetEvent.cs
- TogglePattern.cs
- sqlmetadatafactory.cs
- InternalBase.cs
- TextRangeEdit.cs
- PageStatePersister.cs
- VideoDrawing.cs
- DBSchemaTable.cs
- PowerEase.cs
- MultiDataTrigger.cs
- XmlIncludeAttribute.cs
- AssemblyNameProxy.cs
- StateDesigner.CommentLayoutGlyph.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- CompileXomlTask.cs
- LogicalTreeHelper.cs
- ImageClickEventArgs.cs
- WorkflowExecutor.cs
- ThreadExceptionEvent.cs
- ItemCheckEvent.cs
- EnumerableValidator.cs
- NavigationExpr.cs
- MorphHelper.cs
- ConsumerConnectionPoint.cs
- SQLMembershipProvider.cs
- EventlogProvider.cs
- VerticalAlignConverter.cs
- JsonQNameDataContract.cs
- PageContentAsyncResult.cs
- XmlReader.cs
- CustomAttribute.cs
- CLSCompliantAttribute.cs
- XmlSchemaGroup.cs
- Boolean.cs
- ActivityTypeResolver.xaml.cs
- OrthographicCamera.cs
- LinkUtilities.cs
- DictionaryContent.cs
- BindingExpression.cs
- KeyConstraint.cs
- BitVector32.cs
- InvalidWMPVersionException.cs
- VirtualPathData.cs
- AQNBuilder.cs
- ToolStripDesigner.cs
- Timer.cs
- ToolStripItemImageRenderEventArgs.cs
- BulletChrome.cs
- ContentIterators.cs
- AppDomainProtocolHandler.cs
- CorruptStoreException.cs
- XmlILOptimizerVisitor.cs
- CaseExpr.cs
- cookiecollection.cs
- TextLineBreak.cs