ToaCategories Class

Represents a table of authorities categories.

ExpandedInheritance Hierarchy

SystemObject
  Aspose.Words.FieldsToaCategories

Namespace:  Aspose.Words.Fields
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.10.0

ExpandedSyntax

public class ToaCategories

The ToaCategories type exposes the following members.

ExpandedConstructors

  NameDescription
Public methodToaCategories
Initializes a new instance of the ToaCategories class

ExpandedProperties

  NameDescription
Public propertyStatic memberCode exampleDefaultCategories
Gets the default table of authorities categories.
Public propertyCode exampleItem
Gets or sets the category heading by category number.

ExpandedMethods

  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)

ExpandedExamples

Shows how to specify a table of authorities categories for a document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// There are default category values we can use, or we can make our own like this
ToaCategories toaCategories = new ToaCategories();
doc.FieldOptions.ToaCategories = toaCategories;

toaCategories[1] = "My Category 1"; // Replaces default value "Cases"
toaCategories[2] = "My Category 2"; // Replaces default value "Statutes"

// Even if we changed the categories in the FieldOptions object, the default categories are still available here
Assert.AreEqual("Cases", ToaCategories.DefaultCategories[1]);
Assert.AreEqual("Statutes", ToaCategories.DefaultCategories[2]);

// Insert 2 tables of authorities, one per category
builder.InsertField("TOA \\c 1 \\h", null);
builder.InsertField("TOA \\c 2 \\h", null);
builder.InsertBreak(BreakType.PageBreak);

// Insert TOA entries across 2 categories
builder.InsertField("TA \\c 2 \\l \"entry 1\"");
builder.InsertBreak(BreakType.PageBreak);
builder.InsertField("TA \\c 1 \\l \"entry 2\"");
builder.InsertBreak(BreakType.PageBreak);
builder.InsertField("TA \\c 2 \\l \"entry 3\"");

doc.UpdateFields();
doc.Save(ArtifactsDir + "FieldOptions.TOA.Categories.docx");

ExpandedSee Also