C# Class EnterpriseWebLibrary.EnterpriseWebFramework.EwfResponse

An HTTP response, minus any caching information.
Mostra file Open project: enduracode/enterprise-web-library Class Usage Examples

Public Methods

Method Description
Create ( string contentType, EnterpriseWebLibrary.EnterpriseWebFramework.EwfResponseBodyCreator bodyCreator, Func fileNameCreator = null ) : EwfResponse

Creates a response.

CreateExcelWorkbookResponse ( Func extensionlessFileNameCreator, Func workbookCreator ) : EwfResponse

Creates an Excel workbook response. Automatically converts the specified file name to a safe file name.

CreateMergedCsvResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, IEnumerable fieldNames ) : EwfResponse

Creates a response containing a comma-separated values (CSV) file created from the top level of a row tree. There will be one column for each merge field specified in the list of field names.

CreateMergedExcelWorkbookResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, IEnumerable fieldNames, bool useMsWordFieldNames = false ) : EwfResponse

Creates a response containing a single-sheet Excel workbook created from the top level of a row tree. There will be one column for each merge field specified in the list of field names. Each column head will be named by calling ToEnglishFromCamel on the merge field's name or using the Microsoft Word name without modification, the latter if useMsWordFieldNames is true.

CreateMergedMsWordDocResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, bool ensureAllFieldsHaveValues, Action inputStreamProvider ) : EwfResponse

Creates a response by merging a row tree with a Microsoft Word document. If you would like each row to be on a separate page, set the first paragraph in the input file to have a page break before it.

CreateMergedMsWordDocResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, bool ensureAllFieldsHaveValues, string inputFilePath ) : EwfResponse

Creates a response by merging a row tree with a Microsoft Word document. If you would like each row to be on a separate page, set the first paragraph in the input file to have a page break before it.

EwfResponse ( FullResponse fullResponse ) : System

EWF use only.

Private Methods

Method Description
CreateFullResponse ( ) : FullResponse
EwfResponse ( string contentType, Func fileNameCreator, EnterpriseWebLibrary.EnterpriseWebFramework.EwfResponseBodyCreator bodyCreator ) : System

Method Details

Create() public static method

Creates a response.
public static Create ( string contentType, EnterpriseWebLibrary.EnterpriseWebFramework.EwfResponseBodyCreator bodyCreator, Func fileNameCreator = null ) : EwfResponse
contentType string 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.
bodyCreator EnterpriseWebLibrary.EnterpriseWebFramework.EwfResponseBodyCreator The response body creator.
fileNameCreator Func 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.
return EwfResponse

CreateExcelWorkbookResponse() public static method

Creates an Excel workbook response. Automatically converts the specified file name to a safe file name.
public static CreateExcelWorkbookResponse ( Func extensionlessFileNameCreator, Func workbookCreator ) : EwfResponse
extensionlessFileNameCreator Func
workbookCreator Func
return EwfResponse

CreateMergedCsvResponse() public static method

Creates a response containing a comma-separated values (CSV) file created from the top level of a row tree. There will be one column for each merge field specified in the list of field names.
public static CreateMergedCsvResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, IEnumerable fieldNames ) : EwfResponse
extensionlessFileNameCreator Func
rowTree EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree
fieldNames IEnumerable
return EwfResponse

CreateMergedExcelWorkbookResponse() public static method

Creates a response containing a single-sheet Excel workbook created from the top level of a row tree. There will be one column for each merge field specified in the list of field names. Each column head will be named by calling ToEnglishFromCamel on the merge field's name or using the Microsoft Word name without modification, the latter if useMsWordFieldNames is true.
public static CreateMergedExcelWorkbookResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, IEnumerable fieldNames, bool useMsWordFieldNames = false ) : EwfResponse
extensionlessFileNameCreator Func
rowTree EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree
fieldNames IEnumerable
useMsWordFieldNames bool
return EwfResponse

CreateMergedMsWordDocResponse() public static method

Creates a response by merging a row tree with a Microsoft Word document. If you would like each row to be on a separate page, set the first paragraph in the input file to have a page break before it.
public static CreateMergedMsWordDocResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, bool ensureAllFieldsHaveValues, Action inputStreamProvider ) : EwfResponse
extensionlessFileNameCreator Func
rowTree EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree
ensureAllFieldsHaveValues bool
inputStreamProvider Action
return EwfResponse

CreateMergedMsWordDocResponse() public static method

Creates a response by merging a row tree with a Microsoft Word document. If you would like each row to be on a separate page, set the first paragraph in the input file to have a page break before it.
public static CreateMergedMsWordDocResponse ( Func extensionlessFileNameCreator, EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree rowTree, bool ensureAllFieldsHaveValues, string inputFilePath ) : EwfResponse
extensionlessFileNameCreator Func
rowTree EnterpriseWebLibrary.MailMerging.RowTree.MergeRowTree
ensureAllFieldsHaveValues bool
inputFilePath string
return EwfResponse

EwfResponse() public method

EWF use only.
public EwfResponse ( FullResponse fullResponse ) : System
fullResponse FullResponse
return System