AssignmentToColumnTextConverter

AssignmentToColumnTextConverter delegate

ResourceAssignment data to column’s string converter.

public delegate string AssignmentToColumnTextConverter(ResourceAssignment assignment);
ParameterTypeDescription
assignmentResourceAssignmentThe assignment to convert.

Return Value

String data for the column.

Examples

Shows how to add columns for assignment views.

var project = new Project(DataDir + "CreateProject2.mpp");

var options = new Spreadsheet2003SaveOptions();

var column = new AssignmentViewColumn("Notes", 200, delegate(ResourceAssignment assignment) { return assignment.Get(Asn.NotesText); });
options.AssignmentView.Columns.Add(column);

foreach (var assignment in project.ResourceAssignments)
{
    foreach (var col in options.AssignmentView.Columns)
    {
        var assnCol = (AssignmentViewColumn)col;
        Console.WriteLine("Column Field: " + assnCol.Field);
        Console.WriteLine("Column Text ( converted ): " + assnCol.GetColumnText(assignment));
        Console.WriteLine();
    }
}

project.Save(OutDir + "UsingSpreadsheet2003SaveOptions_out.xml", options);

See Also