コード例 #1
0
 /// <summary>
 /// Apply HTML template
 /// </summary>
 /// Apply operations to fill in an HTML template, generating a final HTML
 /// result
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// Operations to apply to template
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ApplyHtmlTemplateOKResponse> ApplyHtmlTemplateAsync(this IConvertTemplate operations, Value value, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ApplyHtmlTemplateWithHttpMessagesAsync(value, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// Apply HTML template
 /// </summary>
 /// Apply operations to fill in an HTML template, generating a final HTML
 /// result
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// Operations to apply to template
 /// </param>
 public static ApplyHtmlTemplateOKResponse ApplyHtmlTemplate(this IConvertTemplate operations, Value value)
 {
     return(Task.Factory.StartNew(s => ((IConvertTemplate)s).ApplyHtmlTemplateAsync(value), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }