C# Class Aspose.Words.Examples.CSharp.Mail_Merge.ApplyCustomLogicToEmptyRegions

Show file Open project: aspose-words/Aspose.Words-for-.NET

Public Methods

Method Description
ExecuteCustomLogicOnEmptyRegions ( Document doc, IFieldMergingCallback handler ) : void

Applies logic defined in the passed handler class to all unused regions in the document. This allows to manually control How unused regions are handled in the document.

ExecuteCustomLogicOnEmptyRegions ( Document doc, IFieldMergingCallback handler, ArrayList regionsList ) : void

Applies logic defined in the passed handler class to specific unused regions in the document as defined in regionsList. This allows to manually control How unused regions are handled in the document.

Run ( ) : void

Private Methods

Method Description
CreateDataRelation ( DataSet dataSet ) : void
CreateDataSourceFromDocumentRegions ( Document doc, ArrayList regionsList ) : DataSet

Returns a DataSet object containing a DataTable for the unmerged regions in the specified document. If regionsList is null all regions found within the document are included. If an ArrayList instance is present The only the regions specified in the list that are found in the document are added.

DisableForeignKeyConstraints ( DataSet dataSet ) : void
GetDataSource ( ) : DataSet

Returns the data used to merge the TestFile document. This dataset purposely contains only rows for the StoreDetails region and only a select few for the child region.

Method Details

ExecuteCustomLogicOnEmptyRegions() public static method

Applies logic defined in the passed handler class to all unused regions in the document. This allows to manually control How unused regions are handled in the document.
public static ExecuteCustomLogicOnEmptyRegions ( Document doc, IFieldMergingCallback handler ) : void
doc Document The document containing unused regions
handler IFieldMergingCallback The handler which implements the IFieldMergingCallback interface and defines the logic to be applied to each unmerged region.
return void

ExecuteCustomLogicOnEmptyRegions() public static method

Applies logic defined in the passed handler class to specific unused regions in the document as defined in regionsList. This allows to manually control How unused regions are handled in the document.
public static ExecuteCustomLogicOnEmptyRegions ( Document doc, IFieldMergingCallback handler, ArrayList regionsList ) : void
doc Document The document containing unused regions
handler IFieldMergingCallback The handler which implements the IFieldMergingCallback interface and defines the logic to be applied to each unmerged region.
regionsList System.Collections.ArrayList A list of strings corresponding to the region names that are to be handled by the supplied handler class. Other regions encountered will not be handled and are removed automatically.
return void

Run() public static method

public static Run ( ) : void
return void