com.esri.arcgis.framework
Interface ITemplates

All Superinterfaces:
Serializable
All Known Implementing Classes:
ITemplatesProxy, Templates

public interface ITemplates
extends Serializable

Provides access to members that query the templates collection.

Description

The Templates collection references the template objects that are currently loaded with the application. A template is a document that is used as a starting point for creating new documents. It carries customizations of several types—user interface, VBA project, and application-specific data. ArcMap has two or three templates loaded with an application. If the document is based on the Normal template, two items are in the templates collection. If the document is based on a project template, three items are in the templates collection. ArcCatalog always has one item in the templates collection; this item represents Normal.gxt.

Remarks

Note, the esriDisplay library contains an object called Template that is unrelated to this Templates collection.

When To Use

The ITemplates interface allows you to get a count of the loaded templates and get the pathnames of those templates. Use IApplication.Templates to get a reference to the templates collection.

Product Availability

Available with ArcGIS Desktop.

See Also:
IApplication.getTemplates()

Method Summary
 int getCount()
          The number of templates associated with the current document.
 String getItem(int index)
          The pathname to the template at the given index.
 

Method Detail

getCount

int getCount()
             throws IOException,
                    AutomationException
The number of templates associated with the current document.

Remarks

In ArcCatalog, Count is always 1. The Normal template is the only template or document loaded.
In ArcMap, Count is either 2 or 3. The Normal template and a document are always loaded. If there is also a base template loaded then the count becomes 3.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItem

String getItem(int index)
               throws IOException,
                      AutomationException
The pathname to the template at the given index.

Product Availability

Available with ArcGIS Desktop.

Parameters:
index - The index (in)
Returns:
The pathName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.