This document is archived and information here might be outdated. Recommended version. |
Provides access to members that find edit tasks by name.
Name | Description | |
---|---|---|
TaskByUniqueName | An edit task by unique name. |
Classes | Description |
---|---|
Editor | The Object Editor Extension. |
Use IEditTaskSearch::TaskByUniqueName to quickly find an edit task. This is helpful because you don't need to loop over all the edit tasks and check their names to see if you are getting the task you want, and it is robust as it allows you to uniquely identify a task regardless of its name.
You can find edit tasks by this method only if the task implements IEditTaskName.
///
public void SetEditTaskToModifyFeature() { /// This sample sets the editors task to Modify Feature///
//get editor extension
UID editorUID = new UIDClass();
editorUID.Value = "esriEditor.Editor";
IEditor editor = m_application.FindExtensionByCLSID(editorUID) as IEditor;
//use the unique task name to get the Modify Feature task
IEditTaskSearch editTaskSearch = editor as IEditTaskSearch;
//set the task returned to the current edit task
IEditTask editTask = editTaskSearch.get_TaskByUniqueName("GarciaUI_ModifyFeatureTask");
if(editTask != null)
{
editor.CurrentTask = editTask;
}
}