Provides access to members that control the annotation constructors.
Product Availability
Available with ArcGIS Desktop.
Members
Description | ||
---|---|---|
Next | The next constructor in the enumeration. | |
Reset | Resets the enumerator such that a subsequent next returns the first constructor. |
Remarks
Use IEnumAnnotationConstructor to cycle through each AnnotationConstructor registered in the 'ESRI Annotation Constructors' component category.
[C#]
/// Use the sample code below to set the current annotation constructor.
/// The method takes a string representing the annotation constructor name as input.
///
public void SetAnnotationConstructorText(String constructorName)
{
UID editorUid = new UIDClass();
editorUid.Value = "esriEditor.Editor";
IEditor editor = m_application.FindExtensionByCLSID(editorUid) as IEditor;
UID annotationId = new UIDClass();
annotationId.Value = "esriEditor.AnnotationEditExtension";
IAnnotationEditExtension annotationExtension = editor.FindExtension(annotationId) as IAnnotationEditExtension;
IEnumAnnotationConstructor enumConstructor = annotationExtension.AnnotationConstructors;
enumConstructor.Reset();
IAnnotationConstructor currentConstructor = enumConstructor.Next();
while(currentConstructor != null)
{
if (currentConstructor.Name == constructorName)
{
annotationExtension.CurrentConstructor = currentConstructor;
return;
}
currentConstructor = enumConstructor.Next();
}
}