Ejemplo n.º 1
0
 /// <summary>
 /// EWF use only.
 /// </summary>
 public EwfResponse(FullResponse fullResponse)
 {
     ContentType     = fullResponse.ContentType;
     FileNameCreator = () => fullResponse.FileName;
     BodyCreator     = fullResponse.TextBody != null
                                       ? new EwfResponseBodyCreator(() => fullResponse.TextBody)
                                       : new EwfResponseBodyCreator(() => fullResponse.BinaryBody);
 }
 /// <summary>
 /// EWF use only.
 /// </summary>
 public EwfResponse( FullResponse fullResponse )
 {
     ContentType = fullResponse.ContentType;
     FileNameCreator = () => fullResponse.FileName;
     BodyCreator = fullResponse.TextBody != null
                       ? new EwfResponseBodyCreator( () => fullResponse.TextBody )
                       : new EwfResponseBodyCreator( () => fullResponse.BinaryBody );
 }
Ejemplo n.º 3
0
 private EwfResponse(string contentType, Func <string> fileNameCreator, EwfResponseBodyCreator bodyCreator)
 {
     ContentType     = contentType;
     FileNameCreator = fileNameCreator;
     BodyCreator     = bodyCreator;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a response.
 /// </summary>
 /// <param name="contentType">The media type of the response. We recommend that you always specify this, but pass the empty string if you don't have it. Do
 /// not pass null.</param>
 /// <param name="bodyCreator">The response body creator.</param>
 /// <param name="fileNameCreator">A function that creates the file name for saving the response. If you return a nonempty string, the response will be
 /// processed as an attachment with the specified file name. Do not return null from the function.</param>
 public static EwfResponse Create(string contentType, EwfResponseBodyCreator bodyCreator, Func <string> fileNameCreator = null)
 {
     return(new EwfResponse(contentType, fileNameCreator ?? (() => ""), bodyCreator));
 }
 /// <summary>
 /// Creates a response.
 /// </summary>
 /// <param name="contentType">The media type of the response. We recommend that you always specify this, but pass the empty string if you don't have it. Do
 /// not pass null.</param>
 /// <param name="bodyCreator">The response body creator.</param>
 /// <param name="fileNameCreator">A function that creates the file name for saving the response. If you return a nonempty string, the response will be
 /// processed as an attachment with the specified file name. Do not return null from the function.</param>
 /// <param name="additionalHeaderFieldGetter">A function that gets additional HTTP header fields for the response.</param>
 public static EwfResponse Create(
     string contentType, EwfResponseBodyCreator bodyCreator, Func <string> fileNameCreator = null,
     Func <IReadOnlyCollection <(string, string)> > additionalHeaderFieldGetter            = null)
 /// <summary>
 /// Creates a response. 
 /// </summary>
 /// <param name="contentType">The media type of the response. We recommend that you always specify this, but pass the empty string if you don't have it. Do
 /// not pass null.</param>
 /// <param name="bodyCreator">The response body creator.</param>
 /// <param name="fileNameCreator">A function that creates the file name for saving the response. If you return a nonempty string, the response will be
 /// processed as an attachment with the specified file name. Do not return null from the function.</param>
 public static EwfResponse Create( string contentType, EwfResponseBodyCreator bodyCreator, Func<string> fileNameCreator = null )
 {
     return new EwfResponse( contentType, fileNameCreator ?? ( () => "" ), bodyCreator );
 }
 private EwfResponse( string contentType, Func<string> fileNameCreator, EwfResponseBodyCreator bodyCreator )
 {
     ContentType = contentType;
     FileNameCreator = fileNameCreator;
     BodyCreator = bodyCreator;
 }
 /// <summary>
 /// Creates a response. 
 /// </summary>
 /// <param name="contentType">The media type of the response. We recommend that you always specify this, but pass the empty string if you don't have it. Do
 /// not pass null.</param>
 /// <param name="bodyCreator">The response body creator.</param>
 /// <param name="fileNameCreator">A function that creates the file name for saving the response. If you return a nonempty string, the response will be
 /// processed as an attachment with the specified file name. Do not return null from the function.</param>
 public EwfResponse( string contentType, EwfResponseBodyCreator bodyCreator, Func<string> fileNameCreator = null )
 {
     ContentType = contentType;
     FileNameCreator = fileNameCreator ?? ( () => "" );
     BodyCreator = bodyCreator;
 }