protected override void OnClick()
        {
            ConfigUtil.type = "gas";
            if (m_editor.EditState != esriEditState.esriStateEditing)
            {
                Enabled = false;
                return;
            }
            m_editor.StartOperation();
            List <MergeSplitGeoNetFeatures> m_Config = null;

            m_Config = ConfigUtil.GetMergeSplitConfig();
            string resetFlow = AddLateralsFromPoint.AddLateralsFromMainPoint(ArcMap.Application, ConfigUtil.GetAddLateralsFromMainConfig(), null, false, false, false, m_Config[0]);

            // 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);



            (ArcMap.Document as IMxDocument).ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, null, (ArcMap.Document as IMxDocument).ActiveView.Extent.Envelope);


            if (resetFlow.ToUpper() == "DIGITIZED")
            {
                Globals.GetCommand("A4GasUtilities_EstablishFlowDigitized", ArcMap.Application).Execute();
            }
            else if (resetFlow.ToUpper() == "ROLE")
            {
                Globals.GetCommand("A4GasUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
            }
            else if (resetFlow.ToUpper() == "Ancillary".ToUpper())
            {
                Globals.GetCommand("A4GasUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
            }
            else
            {
            }
            m_editor.StopOperation("Create asset and lateral");
        }
        private void OnSketchFinished()
        {
            //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;
            }
        }