C# Класс Aspose.Words.Examples.CSharp.Mail_Merge.LINQtoXMLMailMerge.MyMailMergeDataSource

Aspose.Words does not accept LINQ queries as an input for mail merge directly, But provides a generic mechanism which allows mail merges from any data source. This class is a simple implementation of the Aspose.Words custom mail merge data source Interface that accepts a LINQ query (in fact any IEnumerable object). Aspose.Words calls this class during the mail merge to retrieve the data.
Наследование: IMailMergeDataSource
Показать файл Открыть проект

Открытые методы

Метод Описание
GetChildDataSource ( string tableName ) : IMailMergeDataSource
GetValue ( string fieldName, object &fieldValue ) : bool

Aspose.Words calls this method to get a value for every data field. This is a simple "generic" implementation of a data source that can work over Any IEnumerable collection. This implementation assumes that the merge field Name in the document matches the name of a public property on the object In the collection and uses reflection to get the value of the property.

MoveNext ( ) : bool

Moves to the next record in the collection.

MyMailMergeDataSource ( IEnumerable data ) : Aspose.Words

Creates a new instance of a custom mail merge data source.

MyMailMergeDataSource ( IEnumerable data, string tableName ) : Aspose.Words

Creates a new instance of a custom mail merge data source, for mail merge with regions.

Описание методов

GetChildDataSource() публичный Метод

public GetChildDataSource ( string tableName ) : IMailMergeDataSource
tableName string
Результат IMailMergeDataSource

GetValue() публичный Метод

Aspose.Words calls this method to get a value for every data field. This is a simple "generic" implementation of a data source that can work over Any IEnumerable collection. This implementation assumes that the merge field Name in the document matches the name of a public property on the object In the collection and uses reflection to get the value of the property.
public GetValue ( string fieldName, object &fieldValue ) : bool
fieldName string
fieldValue object
Результат bool

MoveNext() публичный Метод

Moves to the next record in the collection.
public MoveNext ( ) : bool
Результат bool

MyMailMergeDataSource() публичный Метод

Creates a new instance of a custom mail merge data source.
public MyMailMergeDataSource ( IEnumerable data ) : Aspose.Words
data IEnumerable Data returned from a LINQ query.
Результат Aspose.Words

MyMailMergeDataSource() публичный Метод

Creates a new instance of a custom mail merge data source, for mail merge with regions.
public MyMailMergeDataSource ( IEnumerable data, string tableName ) : Aspose.Words
data IEnumerable Data returned from a LINQ query.
tableName string Name of the data source is only used when you perform mail merge with regions. /// If you prefer to use the simple mail merge then use constructor with one parameter.
Результат Aspose.Words