This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Editor > ESRI.ArcGIS.Editor > Interfaces > IE > IEnumAnnotationConstructor Interface (ArcObjects .NET 10.4 SDK) |
Provides access to members that control the annotation constructors.
Description | ||
---|---|---|
Next | The next constructor in the enumeration. | |
Reset | Resets the enumerator such that a subsequent next returns the first constructor. |
Use IEnumAnnotationConstructor to cycle through each AnnotationConstructor registered in the 'ESRI Annotation Constructors' component category.
/// 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();
}
}