TextStyle Class

Change the visual style of the text for an item in the project view.
Inheritance Hierarchy

Namespace:  Aspose.Tasks.Visualization
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.5
public class TextStyle

The TextStyle type exposes the following members.

Public methodCode exampleTextStyle
Initializes a new instance of the TextStyle class.
Public propertyCode exampleBackgroundColor
Gets or sets background color of the text style. Color.
Public propertyCode exampleBackgroundPattern
Gets or sets background pattern of the text style. BackgroundPattern.
Public propertyCode exampleColor
Gets or sets color of the text.
Public propertyCode exampleFontFamily
Gets or sets FontFamily of the text style.
Public propertyCode exampleFontStyle
Gets or sets FontStyle of the text style font.
Public propertyCode exampleItemType
Gets or sets TextItemType of the text style.
Public propertyCode exampleSizeInPoints
Gets or sets size in points of the text style font.
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.)
Shows how to customize text styles which are used to style different text items in a project.
var project = new Project(DataDir + "CreateProject2.mpp");
SaveOptions options = new PdfSaveOptions
    PresentationFormat = PresentationFormat.ResourceSheet

var style = new TextStyle();
style.Color = Color.OrangeRed;
style.FontStyle = FontStyle.Bold;
style.FontStyle |= FontStyle.Italic;
style.ItemType = TextItemType.OverallocatedResources;
style.BackgroundColor = Color.Aqua;
style.BackgroundPattern = BackgroundPattern.DarkDither;
style.FontFamily = FontFamily.GenericMonospace;
style.SizeInPoints = 10;

options.TextStyles = new List<TextStyle>
project.Save(OutDir + "CustomizeTextStyle_out.pdf", options);
See Also