GroupCriterion Class

Represents a criterion in a group definition. The GroupCriterion object is a member of the GroupCriterionCollection collection.
Inheritance Hierarchy
SystemObject
  Aspose.TasksGroupCriterion

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
public class GroupCriterion

The GroupCriterion type exposes the following members.

Constructors
  NameDescription
Public methodGroupCriterion
Initializes a new instance of the GroupCriterion class
Properties
  NameDescription
Public propertyCode exampleAscending
Gets or sets a value indicating whether a field used as a criterion in a group definition is sorted in ascending order. False if the field is sorted in descending order.
Public propertyCode exampleCellColor
Gets or sets the color of the cell background for a field used as a criterion in a group definition.
Public propertyCode exampleField
Gets or sets the field being grouped by.
Public propertyCode exampleFont
Gets or sets the font for a criterion in a group definition.
Public propertyCode exampleFontColor
Gets or sets the color of the font for a field used as a criterion in a group definition.
Public propertyCode exampleGroupInterval
Gets or sets the interval for a field used as a criterion in a group definition.
Public propertyCode exampleGroupOn
Gets or sets the type of grouping for a field used as a criterion in a group definition.
Public propertyCode exampleIndex
Gets the index of a GroupCriterion object in the containing GroupCriterionCollection collection.
Public propertyCode exampleParentGroup
Gets the parent of the GroupCriterion object.
Public propertyCode examplePattern
Gets or sets the pattern of the cell for a field used as a criterion in a group definition.
Public propertyCode exampleStartAt
Gets or sets the start of the intervals for a field used as a criterion in a group definition.
Methods
  NameDescription
Public methodCode exampleEquals
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ObjectEquals(Object).)
Protected methodFinalize (Inherited from Object.)
Public methodCode exampleGetHashCode
Serves as a hash function for a particular type.
(Overrides ObjectGetHashCode.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to work with a group criterion.
var project = new Project(DataDir + "ReadGroupDefinitionData.mpp");

Console.WriteLine("Task Groups Count: " + project.TaskGroups.Count);
var group = project.TaskGroups.ToList()[1];
Console.WriteLine("Task Group Name: " + group.Name);
Console.WriteLine("Task Group Criteria count: " + group.GroupCriteria.Count);

Console.WriteLine("\n************* Retrieving Task Group's Criterion information *************");
var criterion = group.GroupCriteria.ToList()[0];
Console.WriteLine("Task Criterion Index: " + criterion.Index);
Console.WriteLine("Task Criterion Field: " + criterion.Field);
Console.WriteLine("Task Criterion GroupOn: " + criterion.GroupOn);
Console.WriteLine("Task Criterion Cell Color: " + criterion.CellColor);
Console.WriteLine("Task Criterion Font Color: " + criterion.FontColor);
Console.WriteLine("Task Criterion Group Interval: " + criterion.GroupInterval);
Console.WriteLine("Task Criterion Start At: " + criterion.StartAt);

// read the background pattern of the criterion  
Console.WriteLine("Task Criterion Pattern: " + criterion.Pattern);

if (group == criterion.ParentGroup)
{
    Console.WriteLine("Parent Group is equal to task Group.");
}

Console.WriteLine("\n*********** Retrieving Criterion's Font Information ***********");
Console.WriteLine("Font Name: " + criterion.Font.Name);
Console.WriteLine("Font Size: " + criterion.Font.Size);
Console.WriteLine("Font Style: " + criterion.Font.Style);
Console.WriteLine("Ascending/Descending: " + criterion.Ascending);
See Also