/// <summary> /// Disables this <see cref="CloudJob"/>. Disabled jobs do not run new tasks, but may be re-enabled later. /// </summary> /// <param name="disableJobOption">Specifies what to do with active tasks associated with the job.</param> /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param> /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="DisableAsync"/>.</remarks> public void Disable(Common.DisableJobOption disableJobOption, IEnumerable <BatchClientBehavior> additionalBehaviors = null) { using (System.Threading.Tasks.Task asyncTask = DisableAsync(disableJobOption, additionalBehaviors)) { asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors); } }
/// <summary> /// Disables this <see cref="CloudJob"/>. Disabled jobs do not run new tasks, but may be re-enabled later. /// </summary> /// <param name="disableJobOption">Specifies what to do with active tasks associated with the job.</param> /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param> /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynchronous operation.</param> /// <returns>A <see cref="System.Threading.Tasks.Task"/> that represents the asynchronous operation.</returns> /// <remarks>The disable operation runs asynchronously.</remarks> public System.Threading.Tasks.Task DisableAsync( Common.DisableJobOption disableJobOption, IEnumerable <BatchClientBehavior> additionalBehaviors = null, CancellationToken cancellationToken = default(CancellationToken)) { // throw if if this object is unbound UtilitiesInternal.ThrowOnUnbound(this.propertyContainer.BindingState); // craft the behavior manager for this call BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors); // start call System.Threading.Tasks.Task asyncTask = this.parentBatchClient.ProtocolLayer.DisableJob(this.Id, disableJobOption, bhMgr, cancellationToken); return(asyncTask); }
/// <summary> /// Disables this <see cref="CloudJob"/>. Disabled jobs do not run new tasks, but may be re-enabled later. /// </summary> /// <param name="disableJobOption">Specifies what to do with active tasks associated with the job.</param> /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param> /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="DisableAsync"/>.</remarks> public void Disable(Common.DisableJobOption disableJobOption, IEnumerable <BatchClientBehavior> additionalBehaviors = null) { Task asyncTask = DisableAsync(disableJobOption, additionalBehaviors); asyncTask.WaitAndUnaggregateException(CustomBehaviors, additionalBehaviors); }