Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Threading / Tasks / TaskCanceledException.cs / 1305376 / TaskCanceledException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // TaskCanceledException.cs // //[....] // // An exception for task cancellations. // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System; using System.Runtime.InteropServices; using System.Runtime.Serialization; namespace System.Threading.Tasks { ////// Represents an exception used to communicate task cancellation. /// [Serializable] public class TaskCanceledException : OperationCanceledException { [NonSerialized] private Task m_canceledTask; // The task which has been canceled. ////// Initializes a new instance of the public TaskCanceledException() : base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage")) { } ///class. /// /// Initializes a new instance of the /// The error message that explains the reason for the exception. public TaskCanceledException(string message) : base(message) { } ////// class with a specified error message. /// /// Initializes a new instance of the /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception. public TaskCanceledException(string message, Exception innerException) : base(message, innerException) { } ////// class with a specified error message and a reference to the inner exception that is the cause of /// this exception. /// /// Initializes a new instance of the /// A task that has been canceled. public TaskCanceledException(Task task) : base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage"), task!=null ? task.CancellationToken:new CancellationToken()) { m_canceledTask = task; } ///class /// with a reference to the that has been canceled. /// /// Initializes a new instance of the /// The/// class with serialized data. /// that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. protected TaskCanceledException(SerializationInfo info, StreamingContext context) : base(info, context) { } /// /// Gets the task associated with this exception. /// ////// It is permissible for no Task to be associated with a /// public Task Task { get { return m_canceledTask; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // TaskCanceledException.cs // //, in which case /// this property will return null. /// [....] // // An exception for task cancellations. // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System; using System.Runtime.InteropServices; using System.Runtime.Serialization; namespace System.Threading.Tasks { ////// Represents an exception used to communicate task cancellation. /// [Serializable] public class TaskCanceledException : OperationCanceledException { [NonSerialized] private Task m_canceledTask; // The task which has been canceled. ////// Initializes a new instance of the public TaskCanceledException() : base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage")) { } ///class. /// /// Initializes a new instance of the /// The error message that explains the reason for the exception. public TaskCanceledException(string message) : base(message) { } ////// class with a specified error message. /// /// Initializes a new instance of the /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception. public TaskCanceledException(string message, Exception innerException) : base(message, innerException) { } ////// class with a specified error message and a reference to the inner exception that is the cause of /// this exception. /// /// Initializes a new instance of the /// A task that has been canceled. public TaskCanceledException(Task task) : base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage"), task!=null ? task.CancellationToken:new CancellationToken()) { m_canceledTask = task; } ///class /// with a reference to the that has been canceled. /// /// Initializes a new instance of the /// The/// class with serialized data. /// that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. protected TaskCanceledException(SerializationInfo info, StreamingContext context) : base(info, context) { } /// /// Gets the task associated with this exception. /// ////// It is permissible for no Task to be associated with a /// public Task Task { get { return m_canceledTask; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007., in which case /// this property will return null. ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Page.cs
- HttpRuntimeSection.cs
- XAMLParseException.cs
- DiscoveryEndpointElement.cs
- FrameworkElement.cs
- BasePropertyDescriptor.cs
- RTLAwareMessageBox.cs
- FreezableCollection.cs
- EventLog.cs
- CultureInfo.cs
- ExpandCollapseProviderWrapper.cs
- WorkflowInstanceProxy.cs
- SetStoryboardSpeedRatio.cs
- XmlDataCollection.cs
- VScrollBar.cs
- Misc.cs
- TabItemAutomationPeer.cs
- UInt64Converter.cs
- StringOutput.cs
- Inflater.cs
- ComNativeDescriptor.cs
- SettingsAttributeDictionary.cs
- EncryptedKeyHashIdentifierClause.cs
- ModuleBuilder.cs
- _KerberosClient.cs
- _BufferOffsetSize.cs
- StructuralObject.cs
- WebPartChrome.cs
- ClientSettingsStore.cs
- SqlDataSourceStatusEventArgs.cs
- BindingMAnagerBase.cs
- ReferencedCollectionType.cs
- InternalConfigSettingsFactory.cs
- DependencyObjectProvider.cs
- DSASignatureFormatter.cs
- Cursor.cs
- DataServiceException.cs
- SqlDeflator.cs
- TableRowGroup.cs
- Int32.cs
- CodeObjectCreateExpression.cs
- FileDocument.cs
- ViewPort3D.cs
- PersonalizationProviderHelper.cs
- DateTimeValueSerializerContext.cs
- ItemsPanelTemplate.cs
- CompositeDataBoundControl.cs
- Viewport3DAutomationPeer.cs
- ExpressionLexer.cs
- CollectionViewGroupRoot.cs
- TraceRecords.cs
- NullExtension.cs
- IsolatedStoragePermission.cs
- ControlCachePolicy.cs
- CatalogPart.cs
- ObjectStorage.cs
- DataDocumentXPathNavigator.cs
- LoginView.cs
- DataGridViewColumnCollectionEditor.cs
- OdbcError.cs
- PolyBezierSegment.cs
- Pair.cs
- RTTypeWrapper.cs
- PngBitmapDecoder.cs
- CqlBlock.cs
- ExpressionConverter.cs
- ResolveNameEventArgs.cs
- CellTreeNodeVisitors.cs
- MultiByteCodec.cs
- EdmComplexTypeAttribute.cs
- ItemAutomationPeer.cs
- LoginUtil.cs
- X509Certificate.cs
- ScrollChrome.cs
- TrustManager.cs
- TemplatePartAttribute.cs
- TaiwanCalendar.cs
- DataGridPagerStyle.cs
- MetaType.cs
- TraceXPathNavigator.cs
- FileDialog_Vista.cs
- ServicePoint.cs
- ListViewDeletedEventArgs.cs
- NextPreviousPagerField.cs
- HTMLTagNameToTypeMapper.cs
- PersonalizationProviderCollection.cs
- HttpCachePolicy.cs
- NumericUpDown.cs
- IPHostEntry.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- _NetworkingPerfCounters.cs
- ComMethodElement.cs
- EntityEntry.cs
- CatalogPartDesigner.cs
- IdentityModelStringsVersion1.cs
- CodeAttributeArgumentCollection.cs
- HotSpotCollection.cs
- DbConnectionHelper.cs
- DrawingState.cs
- CustomValidator.cs