ArcObjects Library Reference  (Editor)    

IEditTask.Name Property

The name of the edit task.

[Visual Basic 6.0]
Property Name As String
[Visual Basic .NET]
Public ReadOnly Property Name As String
[C#]
public string Name {get;}

Product Availability

Available with ArcGIS Desktop.

Remarks

The Name property is usually used with IEdtior::TaskCount and IEditor::Task to change the editor's current task.  It is not a good idea to set an edit task via its index as this may change and is likely different for different users.

[C#]

Sample to change the current edit task.


private void settask()
  {
    try
    {
      IEditor tEditor;
      //get a reference to IApplication app using ICommand::OnCreate hook parameter.
      tEditor = app.FindExtensionByName("ESRI Object Editor") as IEditor;
      IEditTask tEditTask = tEditor.CurrentTask;
     
      for (int taskCount = 0; taskCount < tEditor.TaskCount; taskCount++)
      {
        tEditTask = tEditor.get_Task(taskCount);

        if (tEditTask.Name == "Reshape Feature")
        {
          tEditor.CurrentTask = tEditTask;
          break;
        }
      }
    }
    catch (exception e)
    {
      MessageBox.Show("Unable to change the task." + e.ToString());
    }
  } 
     

[Visual Basic 6.0] The following example shows how to change the current edit task.
Public Sub SetTask()
  Dim pEditor As IEditor
  Dim pEditTask As IEditTask
  Dim pID As New UID
  Dim TaskCount As Integer
  
  pID = "esriEditor.Editor"
  Set pEditor = Application.FindExtensionByCLSID(pID)
  
  'Loop through the edit tasks checking each one's name
  For TaskCount = 0 To pEditor.TaskCount - 1
    Set pEditTask = pEditor.Task(TaskCount)
    If pEditTask.Name = "Reshape Feature" Then
      Set pEditor.CurrentTask = pEditTask
      Exit Sub
    End If
  Next TaskCount

End Sub 

See Also

IEditTask Interface | IEditTask Interface | IEditSketch Interface | IExtension Interface | esriSketchConstraint Constants | ISketchTool Interface

Example

Parent_Example

 


Feedback Send feedback on this page