ToaCategories Class
Represents a table of authorities categories.
Inheritance Hierarchy
SystemObject
  Aspose.Words.FieldsToaCategories

Namespace: Aspose.Words.Fields
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
Syntax
public class ToaCategories

The ToaCategories type exposes the following members.

Constructors
  NameDescription
Public methodToaCategories
Initializes a new instance of the ToaCategories class
Properties
  NameDescription
Public propertyStatic memberCode exampleDefaultCategories
Gets the default table of authorities categories.
Public propertyCode exampleItem
Gets or sets the category heading by category number.
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 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 table of authorities 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 + "Field.TableOfAuthorities.Categories.docx");
See Also