Ejemplo n.º 1
0
        public void OnFinishSketch()
        {
            //get reference to featurelayer being edited
            IFeatureLayer pFeatureLayer = pEditLayer.TargetLayer as IFeatureLayer;
            //get reference to the sketch geometry
            IGeometry pPolyline = pEditSketch.Geometry;

            if (pPolyline.IsEmpty == false)
            {
                ParaSetting pFormSetting = new ParaSetting(pFeatureLayer.FeatureClass);

                pFormSetting.ShowDialog();


                if (pFormSetting.DialogResult == DialogResult.OK)
                {
                    pHeightName = pFormSetting.pFieldNames.Text;

                    pHeight = Convert.ToDouble(pFormSetting.dHeight.Text);

                    pInterval = Convert.ToDouble(pFormSetting.dInterval.Text);

                    pFormSetting.Dispose();

                    pFormSetting = null;

                    IFeatureCursor pFeatureCursor = GetFeatureCursor(pPolyline, pFeatureLayer.FeatureClass);

                    CalculateIntersect(pFeatureCursor, pPolyline);

                    MessageBox.Show("计算完成");
                }
            }

            //refresh the display
            IActiveView pActiveView = pEngineEditor.Map as IActiveView;

            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, (object)pFeatureLayer, pActiveView.Extent);
        }
Ejemplo n.º 2
0
        public void OnFinishSketch()
        {
            //get reference to featurelayer being edited
            IFeatureLayer pFeatureLayer = pEditLayer.TargetLayer as IFeatureLayer;
            //get reference to the sketch geometry
            IGeometry pPolyline = pEditSketch.Geometry;

            if (pPolyline.IsEmpty == false)
            {
                ParaSetting pFormSetting = new ParaSetting(pFeatureLayer.FeatureClass);

                pFormSetting.ShowDialog();

                if (pFormSetting.DialogResult == DialogResult.OK)
                {
                    pHeightName = pFormSetting.pFieldNames.Text;

                    pHeight = Convert.ToDouble(pFormSetting.dHeight.Text);

                    pInterval = Convert.ToDouble(pFormSetting.dInterval.Text);

                    pFormSetting.Dispose();

                    pFormSetting = null;

                    IFeatureCursor pFeatureCursor = GetFeatureCursor(pPolyline, pFeatureLayer.FeatureClass);

                    CalculateIntersect(pFeatureCursor, pPolyline);

                    MessageBox.Show("计算完成");
                }

            }

            //refresh the display
            IActiveView pActiveView = pEngineEditor.Map as IActiveView;
            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, (object)pFeatureLayer, pActiveView.Extent);
        }