private void OnSketchFinished()
{
ConfigUtil.type = "water";
//m_editor.UndoOperation();
IFeature pFeat = null;
IEnvelope pEnv = null;
try
{
m_editor.StartOperation();
Globals.ClearSelected(ArcMap.Application, false, new List<esriGeometryType>() { esriGeometryType.esriGeometryPoint });
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, false, true);
//CreatePoint(m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate);
if (pFeat == null)
return;
// addLat.AddLateralAtPoint(m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name);
//((IFeatureSelection)m_editor.CurrentTemplate.Layer).Clear();
m_editor.Map.SelectFeature(m_editor.CurrentTemplate.Layer as IFeatureLayer, pFeat);
string resetFlow = AddLateralsFromPoint.AddLateralsFromMainPoint(ArcMap.Application, ConfigUtil.GetAddLateralsFromMainConfig(), pFeat, false, true, false);
// m_editor.Map.SelectFeature(m_editor.CurrentTemplate.Layer as IFeatureLayer, pFeat);
m_editor.Display.Invalidate((ArcMap.Document as IMxDocument).ActiveView.Extent, true, (short)esriScreenCache.esriAllScreenCaches);
pFeat.Store();
(ArcMap.Document as IMxDocument).ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, null, (ArcMap.Document as IMxDocument).ActiveView.Extent.Envelope);
if (resetFlow.ToUpper() == "DIGITIZED")
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowDigitized", ArcMap.Application).Execute();
}
else if (resetFlow.ToUpper() == "ROLE")
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
}
else if (resetFlow.ToUpper() == "Ancillary".ToUpper())
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
}
else
{
}
m_editor.StopOperation(A4LGSharedFunctions.Localizer.GetString("CrtAssetAndLat"));
}
catch (Exception ex)
{
MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("ErrorInThe") + A4LGSharedFunctions.Localizer.GetString("ALT_1") + ex.Message);
m_editor.AbortOperation();
}
finally
{
pFeat = null;
pEnv = null;
}
}