Beispiel #1
0
        private void GetIntersection()
        {
            IEditSketch editSketch = m_editor as IEditSketch;

            editSketch.AddPoint(m_activePoint, true);
            // Set the phase to inactive, back to beginning
            m_etoolPhase = ToolPhase.Inactive;
        }
        void IEditTask.Deactivate()
        {
            //Stop listening for editor events.
            ((IEditEvents_Event)m_editor).OnCurrentLayerChanged -= OnCurrentLayerChanged;

            //Release object references.
            m_editor     = null;
            m_editSketch = null;
            m_editLayer  = null;
            m_mxDoc      = null;
        }
        void IEditTask.Activate(IEditor Editor, IEditTask oldTask)
        {
            if (Editor == null)
            {
                return;
            }

            //Initialize class member variables.
            m_editor     = Editor;
            m_editSketch = Editor as IEditSketch;
            m_editSketch.GeometryType = esriGeometryType.esriGeometryPolyline;
            m_editLayer = Editor as IEditLayers;
            m_mxDoc     = Editor.Parent.Document as IMxDocument;

            //Wire editor events.
            ((IEditEvents_Event)m_editor).OnCurrentLayerChanged +=
                new IEditEvents_OnCurrentLayerChangedEventHandler(OnCurrentLayerChanged);
        }