コード例 #1
0
 /// <summary>
 /// Determine if the JobCollection name is available to be used.
 /// JobCollection names must be unique within a cloud-service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// A name for the JobCollection. The name must be unique as scoped
 /// within the CloudService.  The name can be up to 100 characters in
 /// length.
 /// </param>
 /// <returns>
 /// The Check Name Availability operation response.
 /// </returns>
 public static JobCollectionCheckNameAvailabilityResponse CheckNameAvailability(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     try
     {
         return(operations.CheckNameAvailabilityAsync(cloudServiceName, jobCollectionName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Determine if the JobCollection name is available to be used.
 /// JobCollection names must be unique within a cloud-service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. A name for the JobCollection. The name must be unique as
 /// scoped within the CloudService.  The name can be up to 100
 /// characters in length.
 /// </param>
 /// <returns>
 /// The Check Name Availability operation response.
 /// </returns>
 public static Task <JobCollectionCheckNameAvailabilityResponse> CheckNameAvailabilityAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     return(operations.CheckNameAvailabilityAsync(cloudServiceName, jobCollectionName, CancellationToken.None));
 }