/// <summary>
 /// Creates a source control user with permissions to publish to this
 /// web space.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations.
 /// </param>
 /// <param name='username'>
 /// Required. The user name.
 /// </param>
 /// <param name='password'>
 /// Required. The user password.
 /// </param>
 /// <param name='parameters'>
 /// Optional. Parameters supplied to the Create Publishing User
 /// operation.
 /// </param>
 /// <returns>
 /// The Create Publishing User operation response.
 /// </returns>
 public static WebSpacesCreatePublishingUserResponse CreatePublishingUser(this IWebSpaceOperations operations, string username, string password, WebSpacesCreatePublishingUserParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IWebSpaceOperations)s).CreatePublishingUserAsync(username, password, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #2
0
 /// <summary>
 /// Creates a source control user allowed to publish to this web space.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations.
 /// </param>
 /// <param name='username'>
 /// The user name.
 /// </param>
 /// <param name='password'>
 /// The user password.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Publishing User operation.
 /// </param>
 /// <returns>
 /// The Create Publishing User operation response.
 /// </returns>
 public static WebSpacesCreatePublishingUserResponse CreatePublishingUser(this IWebSpaceOperations operations, string username, string password, WebSpacesCreatePublishingUserParameters parameters)
 {
     try
     {
         return operations.CreatePublishingUserAsync(username, password, parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Creates a source control user with permissions to publish to this
 /// web space.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations.
 /// </param>
 /// <param name='username'>
 /// Required. The user name.
 /// </param>
 /// <param name='password'>
 /// Required. The user password.
 /// </param>
 /// <param name='parameters'>
 /// Optional. Parameters supplied to the Create Publishing User
 /// operation.
 /// </param>
 /// <returns>
 /// The Create Publishing User operation response.
 /// </returns>
 public static Task<WebSpacesCreatePublishingUserResponse> CreatePublishingUserAsync(this IWebSpaceOperations operations, string username, string password, WebSpacesCreatePublishingUserParameters parameters)
 {
     return operations.CreatePublishingUserAsync(username, password, parameters, CancellationToken.None);
 }