How can I programmatically switch to a edittemplate in:
ArcMap 9.3:
IEditLayers pEditLayers;
IFeatureLayer pFeatLayer;
IMap pMap = ((IMxDocument)Application.Document).FocusMap;
pEditLayers = (IEditLayers)Editor;
pMap = Editor.Map;
for (int i = 0; i < pMap.LayerCount; i++)
{
if (pMap.get_Layer(i).Name == "roads")
{
pFeatLayer = (IFeatureLayer)pMap.get_Layer(i);
pEditLayers.SetCurrentLayer(pFeatLayer, SubType);
}
...
ArcMap 10: first idea, but it does not work:
IEditTemplate currentTemplate = m_editor.CurrentTemplate;
for (int i = 0; i < m_editor.TemplateCount -1; i++)
{
IEditTemplate editTemplate = m_editor.get_Template(i);
if (editTemplate.Layer.Name == "roads")
{
currentTemplate = editTemplate;
}
...