TableTextStyle Class

Represents a text style in a view table.
Inheritance Hierarchy
SystemObject
  Aspose.Tasks.VisualizationTextStyle
    Aspose.Tasks.VisualizationTableTextStyle

Namespace:  Aspose.Tasks.Visualization
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.6
Syntax
public class TableTextStyle : TextStyle

The TableTextStyle type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleTableTextStyle
Initializes a new instance of the TableTextStyle class.
Properties
  NameDescription
Public propertyCode exampleBackgroundColor
Gets or sets background color of the text style. Color.
(Inherited from TextStyle.)
Public propertyCode exampleBackgroundPattern
Gets or sets background pattern of the text style. BackgroundPattern.
(Inherited from TextStyle.)
Public propertyCode exampleColor
Gets or sets color of the text.
(Inherited from TextStyle.)
Public propertyCode exampleField
Gets or sets a field the style is to be applied to. Field.
Public propertyCode exampleFontFamily
Gets or sets FontFamily of the text style.
(Inherited from TextStyle.)
Public propertyCode exampleFontStyle
Gets or sets FontStyle of the text style font.
(Inherited from TextStyle.)
Public propertyCode exampleItemType
Returns a value of the TextItemType enum.
(Overrides TextStyleItemType.)
Public propertyCode exampleRowUid
Gets a row unique id.
Remarks
Return -1 if the style is to be applied to all rows of a view.
Public propertyCode exampleSizeInPoints
Gets or sets size in points of the text style font.
(Inherited from TextStyle.)
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to customize table text styles which are used to style different text items in a project.
var project = new Project(DataDir + "Project2.mpp");
project.Set(Prj.NewTasksAreManual, false);

var view = (GanttChartView)project.Views.ToList()[0];

// set first task name text style
var style1 = new TableTextStyle(1);
// set a field the style is to be applied to.
style1.Field = Field.TaskName;
// set <see cref="P:Aspose.Tasks.Visualization.TextStyle.FontStyle" /> of the text style font.
style1.FontStyle = FontStyle.Bold | FontStyle.Italic;
// set <see cref="P:Aspose.Tasks.Visualization.TextStyle.FontFamily" /> of the text style.
style1.FontFamily = new FontFamily("Impact");
// set size in points of the text style font.
style1.SizeInPoints = 12;

// set second task duration text style
var style2 = new TableTextStyle(2);
style2.Field = Field.TaskDurationText;
style2.FontStyle = FontStyle.Underline;
style2.FontFamily = new FontFamily("Impact");
style2.SizeInPoints = 16;

view.TableTextStyles.Add(style1);
view.TableTextStyles.Add(style2);

var options = new MPPSaveOptions
{
    // set a flag indicating that view data must be written
    WriteViewData = true
};
project.Save(OutDir + "WorkWithTableTextStyle_out.mpp", options);
See Also