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
- KeyboardNavigation.cs
- LoginName.cs
- Executor.cs
- unsafenativemethodstextservices.cs
- ResourcePermissionBaseEntry.cs
- SrgsSemanticInterpretationTag.cs
- DeclaredTypeElementCollection.cs
- Int64.cs
- BindingExpression.cs
- NominalTypeEliminator.cs
- Vector3DKeyFrameCollection.cs
- CustomLineCap.cs
- SqlConnectionHelper.cs
- ProcessModuleCollection.cs
- PolicyDesigner.cs
- StoreAnnotationsMap.cs
- RefExpr.cs
- ToolStripSystemRenderer.cs
- ClientBuildManagerCallback.cs
- MailSettingsSection.cs
- XhtmlBasicLabelAdapter.cs
- DataGridViewRowPostPaintEventArgs.cs
- LinearGradientBrush.cs
- AsyncResult.cs
- XamlReaderHelper.cs
- XmlSchemaElement.cs
- CommandID.cs
- AssociationSet.cs
- TypeSystem.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- ObjectTag.cs
- BufferedWebEventProvider.cs
- ErrorEventArgs.cs
- BindingExpression.cs
- EncodingDataItem.cs
- TemplateBindingExpression.cs
- WebAdminConfigurationHelper.cs
- QuaternionConverter.cs
- MimeMultiPart.cs
- AutoGeneratedFieldProperties.cs
- ByteAnimationUsingKeyFrames.cs
- DesignerAttribute.cs
- ExceptionUtil.cs
- XamlSerializationHelper.cs
- LicFileLicenseProvider.cs
- JoinCqlBlock.cs
- FactoryGenerator.cs
- PropertyChange.cs
- ThreadSafeList.cs
- SqlServer2KCompatibilityCheck.cs
- GridViewDeleteEventArgs.cs
- Block.cs
- BmpBitmapDecoder.cs
- UnsafeNativeMethods.cs
- TreeIterator.cs
- CodeMemberProperty.cs
- _AutoWebProxyScriptHelper.cs
- CustomErrorsSection.cs
- DataRow.cs
- DataTableExtensions.cs
- FlowNode.cs
- TreeNodeCollection.cs
- BookmarkResumptionRecord.cs
- CheckBoxStandardAdapter.cs
- MessageSecurityOverMsmqElement.cs
- DefaultExpressionVisitor.cs
- MethodExpr.cs
- Formatter.cs
- MailDefinitionBodyFileNameEditor.cs
- TextEditorParagraphs.cs
- Types.cs
- LinqDataSourceDisposeEventArgs.cs
- MouseOverProperty.cs
- InvalidPropValue.cs
- Set.cs
- SqlDependency.cs
- CollectionEditVerbManager.cs
- SafeMarshalContext.cs
- FormViewModeEventArgs.cs
- sortedlist.cs
- KeyTimeConverter.cs
- TypeResolvingOptions.cs
- SplitterDesigner.cs
- Int32KeyFrameCollection.cs
- HostedElements.cs
- Mutex.cs
- XmlHierarchyData.cs
- Stopwatch.cs
- ConfigXmlDocument.cs
- NotificationContext.cs
- HelpKeywordAttribute.cs
- GenerateTemporaryTargetAssembly.cs
- FamilyTypefaceCollection.cs
- ConfigurationElementProperty.cs
- CodeDomSerializerBase.cs
- Executor.cs
- DataGridColumnHeaderAutomationPeer.cs
- OdbcReferenceCollection.cs
- StorageEntityTypeMapping.cs
- MenuTracker.cs