public DocumentResult(IWordDocument document, string filename, FormatType formattype, HttpResponse response, HttpContentDisposition contentDisposition) { FileName = filename; Document = document; formatType = formattype; Response = response; ContentDisposition = contentDisposition; }
public HttpBodyObject(IReadOnlyDictionary <string, string> fields, string content) { if (fields != null) { if (fields.ContainsKey("content-disposition")) { ContentDisposition = new HttpContentDisposition(fields["content-disposition"]); } else { throw new Exception(); } if (fields.ContainsKey("content-type")) { ContentType = new HttpContentType(fields["content-type"]); } } Content = content; }
/// <summary> /// Export the document as ActionResult, returns the DocResult /// </summary> /// <param name="document">WordDocument to serialize</param> /// <param name="filename">Name of the File</param> /// <param name="formattype">Format type of the document</param> /// <param name="response">Response</param> /// <param name="contentDisposition">HttpContentDisposition</param> /// <returns></returns> public static DocumentResult ExportAsActionResult(this IWordDocument document, string filename, FormatType formattype, HttpResponse response, HttpContentDisposition contentDisposition) { return(new DocumentResult(document, filename, formattype, response, contentDisposition)); }