public AddLateralsConstructionTool()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
Ejemplo n.º 2
0
        private void Initialize()
        {
            _mxdocument = (IMxDocument)_application.Document;
            _map        = _mxdocument.FocusMap;
            _activeView = _mxdocument.ActiveView;

            _editor     = GetEditorFromArcMap(_application as IMxApplication);
            _editEvents = (IEditEvents_Event)_editor;

            _editEvents.OnStopEditing += new IEditEvents_OnStopEditingEventHandler(OnStopEditing);

            _utilitiesArcmap = new Utilities_ArcMap(_map);
            if (this.cboTargetLayer.Items.Count > 0)
            {
                this.cboTargetLayer.Items.Clear();
            }
            this.cboTargetLayer.Items.AddRange(_utilitiesArcmap.FeatureLayers().Select(item => item.Name).ToArray());
            if (this.cboTargetLayer.Items.Count > 0)
            {
                this.cboTargetLayer.SelectedIndex = 0;
                if (this.cboTargetLayer.Items.IndexOf(_targetlayer) > -1)
                {
                    this.cboTargetLayer.Text = _targetlayer;
                }
            }
        }
 public AddLineWithEndPoints()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
        /// <summary>
        /// Constructs a new ConnectionEditorHelper
        /// </summary>
        /// <param name="hook">Hook</param>
        /// <param name="editor">Editor</param>
        public FiberDeviceConnectionHelper(HookHelperExt hookHelper, IEditor3 editor)
//            : base(hook)
//            : base(hook, editor)
        {
            _hookHelper = hookHelper;
            _editor     = editor;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Constructs a new FiberSpliceConfigHelper
        /// </summary>
        /// <param name="hook">Hook</param>
        /// <param name="editor">Editor</param>
        public FiberSpliceHelper(HookHelperExt hookHelper, IEditor3 editor)
//            : base(hook)
//            : base(hook, editor)
        {
            _hookHelper = hookHelper;
            _editor     = editor;
        }
 public ConnectClosestsConstructTool()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public AddPointSplitLine()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
        public void Startup(ref object initializationData)
        {
            try
            {
                m_application = initializationData as IApplication;
                if (m_application == null)
                {
                    return;
                }

                ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass() as ISpatialReferenceFactory;
                m_wgs84 = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984) as ISpatialReference;

                //Get the editor.
                UID editorUid = new UID();
                editorUid.Value = "esriEditor.Editor";
                m_editor3       = m_application.FindExtensionByCLSID(editorUid) as IEditor3;
                m_editEvents2   = m_editor3 as IEditEvents2_Event;
                m_editEvents    = m_editor3 as IEditEvents_Event;

                m_editEvents.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler(m_editEvents_OnCreateFeature);
                m_editEvents.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler(m_editEvents_OnChangeFeature);
                m_editEvents.OnDeleteFeature += new IEditEvents_OnDeleteFeatureEventHandler(m_editEvents_OnDeleteFeature);
                m_editEvents.OnStartEditing  += new IEditEvents_OnStartEditingEventHandler(m_editEvents_OnStartEditing);

                resourceManager = new ResourceManager("ESRI.ArcGIS.OSM.Editor.OSMFeatureInspectorStrings", this.GetType().Assembly);
                _osmUtility     = new OSMClassExtension.OSMUtility();

                // retrtrieve osm editor specfic information
                m_editorConfigurationSettings = OSMGPFactory.ReadOSMEditorSettings();
            }
            catch { }
        }
Ejemplo n.º 9
0
        private void Update(int status, IFeatureLayer buildingsfeaturelayer)
        {
            //Get the editor
            _editor = GetEditorFromArcMap(_application as IMxApplication);
            if (_editor == null)
            {
                MessageBox.Show("Editor version of ArcMap required.", "Building Inspector", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            if (_editor.EditState != esriEditState.esriStateEditing)
            {
                MessageBox.Show("Start an edit session first.", "Building Inspector", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            IFeatureSelection featureselection = buildingsfeaturelayer as IFeatureSelection;

            if (featureselection.SelectionSet.Count == 0)
            {
                MessageBox.Show("Select at least one feature.", "Building Inspector", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }



            IFeatureClass featureclass = buildingsfeaturelayer.FeatureClass;
            IEnumIDs      enumIDs      = featureselection.SelectionSet.IDs;

            _editor.StartOperation();
            enumIDs.Reset();
            int intOID = enumIDs.Next();

            while (intOID != -1)
            {
                IFeature feature = featureclass.GetFeature(intOID);
                if (feature != null)
                {
                    int inspectionfieldindex = _utilitiesArcMap.FindField(featureclass, "rsi");
                    if (inspectionfieldindex > -1)
                    {
                        //_editor.StartOperation();
                        feature.set_Value(inspectionfieldindex, status);
                        //_editor.StopOperation("Status updated!" + feature.OID);
                        feature.Store();
                    }
                    else
                    {
                        throw new Exception("Selected layer does not have the 'rsi field'.");
                    }
                }
                intOID = enumIDs.Next();
            }

            _activeView.Refresh();

            _editor.StopOperation("Inspected...");

            GetStatus();
        }
 public PointsAlongLineTool()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public SampleTraceTool1()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
Ejemplo n.º 12
0
 public CreateLineAndSplitIntersectingLines()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public SampleTraceTool1()
 {
     // Get the editor
       m_editor = ArcMap.Editor as IEditor3;
       m_editEvents = m_editor as IEditEvents_Event;
       m_editEvents5 = m_editor as IEditEvents5_Event;
 }
Ejemplo n.º 14
0
 public CreatePointAndRefPoint()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public CreateLineAndSplitIntersectingLines()
 {
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
        private void btnUndo_Click(object sender, EventArgs e)
        {
            int         entityId    = _entityId;
            IEditor3    editor      = ArcUtils.Editor;
            var         sketch      = editor as IEditSketch3;
            Measurement measurement = Measurement.Get(entityId);

            if (sketch != null)
            {
                if (measurement.IsTypeOfLayer(TypeOfLayer.Point))
                {
                    _frmGlobespotter.RemoveMeasurementPoint(entityId, _pointId);
                    _frmGlobespotter.AddMeasurementPoint(entityId);
                }
                else
                {
                    int              nrPoints;
                    IGeometry        geometry     = sketch.Geometry;
                    IPointCollection ptColl       = measurement.ToPointCollection(geometry, out nrPoints);
                    int              removePoints = ((measurement.IsTypeOfLayer(TypeOfLayer.Polygon)) && (ptColl.PointCount == 2) &&
                                                     (nrPoints == 1)) ? 2 : 1;
                    ptColl.RemovePoints((nrPoints - 1), removePoints);
                    sketch.Geometry = ptColl as IGeometry;
                    IActiveView activeView = ArcUtils.ActiveView;

                    if (activeView != null)
                    {
                        activeView.Refresh();
                    }
                }
            }
        }
 public ParcelConstruction()
 {
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public AddLateralsConstructionTool()
 {
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public AddLateralsConstructionTool()
 {
     ConfigUtil.type = "water";
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
Ejemplo n.º 20
0
 public AddLateralsConstructionTool()
 {
     ConfigUtil.type = "water";
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
Ejemplo n.º 21
0
 public AddPointSplitLine()
 {
     ConfigUtil.type = "water";
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public CreatePointAndRefPoint()
 {
     ConfigUtil.type = "address";
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public CreateLineAndSplitIntersectingLines()
 {
     ConfigUtil.type = "address";
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
Ejemplo n.º 24
0
 public ConnectClosestsConstructTool()
 {
     ConfigUtil.type = "water";
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
Ejemplo n.º 25
0
 public PointsAlongLineTool()
 {
     ConfigUtil.type = "water";
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
        public ConnectClosestsConstructTool()
        {
            ConfigUtil.configFileName = "gas.config";

            // Get the editor
            m_editor      = ArcMap.Editor as IEditor3;
            m_editEvents  = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
        public AddLateralsConstructionTool()
        {
            ConfigUtil.configFileName = "gas.config";

            // Get the editor
            m_editor      = ArcMap.Editor as IEditor3;
            m_editEvents  = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
Ejemplo n.º 28
0
        public AddLateralsFromMainPointConstructionTool()
        {
            ConfigUtil.type = "gas";

            // Get the editor
            m_editor      = ArcMap.Editor as IEditor3;
            m_editEvents  = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
Ejemplo n.º 29
0
        public AddLineWithEndPoints()
        {
            ConfigUtil.type = "gas";

            // Get the editor
            m_editor      = ArcMap.Editor as IEditor3;
            m_editEvents  = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
        public PointsAlongLineTool()
        {
            ConfigUtil.configFileName = "gas.config";

            // Get the editor
            m_editor      = ArcMap.Editor as IEditor3;
            m_editEvents  = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
        public AddPointSplitLine()
        {
            ConfigUtil.configFileName = "gas.config";

            // Get the editor
            m_editor      = ArcMap.Editor as IEditor3;
            m_editEvents  = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
        public AddLateralsConstructionTool()
        {
            ConfigUtil.configFileName = "gas.config";

            // Get the editor
            m_editor = ArcMap.Editor as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
Ejemplo n.º 33
0
        private bool CheckRequirements()
        {
            try
            {
                if (_utilitiesArcMap == null)
                {
                    _application = this.Hook as IApplication;
                    _mxdocument  = (IMxDocument)_application.Document;
                    _map         = _mxdocument.FocusMap;
                    _activeView  = _mxdocument.ActiveView;
                    if (_utilitiesArcMap == null)
                    {
                        _utilitiesArcMap = new Utilities_ArcMap(_map);
                    }
                }

                if (this.cboBuildingLayer.Items.Count == 0)
                {
                    MessageBox.Show("Add a layer to inspect to the table of contents", "Building Inspector", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return(false);
                }

                ILayer buildingslayer       = _utilitiesArcMap.Layer(this.cboBuildingLayer.Text);
                int    inspectionfieldindex = _utilitiesArcMap.FindField(buildingslayer, "rsi");
                if (inspectionfieldindex < 0)
                {
                    MessageBox.Show("Add 'rsi' field, short integer!", "Building Inspector", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return(false);
                }

                _editor = GetEditorFromArcMap(_application as IMxApplication);
                if (_editor == null)
                {
                    MessageBox.Show("Editor version of ArcMap required.", "Building Inspector", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return(false);
                }

                if (_editor.EditState != esriEditState.esriStateEditing)
                {
                    MessageBox.Show("Start an edit session first.", "Building Inspector", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return(false);
                }

                IFeatureLayer buildingsfeaturelayer = buildingslayer as IFeatureLayer;
                IFeatureClass buildingsfeatureclass = buildingsfeaturelayer.FeatureClass;
                _initialfeaturecount = buildingsfeatureclass.FeatureCount(null);
                IQueryFilter queryfilter = new QueryFilterClass();
                queryfilter.WhereClause = "\"rsi\" = 1";
                _initialcompletedrows   = buildingsfeatureclass.FeatureCount(queryfilter);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(true);
        }
Ejemplo n.º 34
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            m_application = hook as IApplication;

            //get the editor
            UID editorUid = new UID();

            editorUid.Value = "esriEditor.Editor";
            m_editor        = m_application.FindExtensionByCLSID(editorUid) as IEditor3;
            m_editEvents    = m_editor as IEditEvents_Event;
            m_editEvents5   = m_editor as IEditEvents5_Event;
        }
Ejemplo n.º 35
0
        public bool CheckSelected()
        {
            IEditor3 editor = ArcUtils.Editor;
            var      sketch = editor as IEditSketch3;
            bool     result = false;

            if (sketch != null)
            {
                result = sketch.IsVertexSelected(0, (_intId - 1));
            }

            return(result);
        }
    public ViperPinForm(IEditor3 editor)
    {
      InitializeComponent();

      m_editor = editor;
      m_edSketch = m_editor as IEditSketch3;
      m_editLayers = m_editor as IEditLayers;

      lblEditLayer.Text = m_editLayers.CurrentLayer.Name;

      //Load field combo box with field names
      IFields pFields = m_editLayers.CurrentLayer.FeatureClass.Fields;
		  for (int i=0; i < pFields.FieldCount; i++)
      {
        cmbPINField.Items.Add(pFields.get_Field(i).Name);
      }

      //get pinfield from registry
      string pinField = null;
      RegistryKey pRegKey = Registry.CurrentUser.OpenSubKey("Software\\ESRI\\ViperPin");
      if (pRegKey != null)
      {
        pinField = pRegKey.GetValue("Pinfield").ToString();
      }

      //set the combo box to the pinfield
      for (int i = 0; i < pFields.FieldCount; i++)
      {
        if (pinField == pFields.get_Field(i).Name)
        {
          cmbPINField.Text = pinField;
          break;
        }
        else
        {
          cmbPINField.Text = "None";
        }
      }

      //cmbPINField.SelectedIndex = 0;
      cmbPINField.Refresh();
      m_lotNum = 1;
      txtlot.Text = "1";

      //Set center right of form to center right of screen
      this.StartPosition = FormStartPosition.Manual;
      this.Left = 0;
      this.Top = (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2);
    }
        public PointsAlongLineForm(IEditor3 editor)
        {
            InitializeComponent();

              m_editor = editor;
              m_edSketch = m_editor as IEditSketch3;

              m_polyline = m_edSketch.Geometry as IPolyline;
              tbLineLength.Text = (m_polyline.Length.ToString("F"));

              //get the template
              m_editTemplate = m_editor.CurrentTemplate;
              m_featureLayer = m_editTemplate.Layer as IFeatureLayer;
              m_featureClass = m_featureLayer.FeatureClass;
        }
        public WorkspaceListener(IEditor3 editor)
        {
            // IEditEvents3_SinkHelper ev = editor as IEditEvents3_SinkHelper;
            //ev.OnStartEditing +=
            IEditEvents_Event ev = editor as IEditEvents_Event;
            IEditEvents2_Event ev2 = editor as IEditEvents2_Event;

            ev.OnStartEditing += WorkspaceListener_OnStartEditing;
            ev.OnStopEditing += ev_OnStopEditing;
            ev.OnCreateFeature += ev_OnCreateFeature;
            ev.OnChangeFeature += ev_OnChangeFeature;
            ev.OnDeleteFeature += ev_OnDeleteFeature;
            ev.OnUndo += ev_OnUndo;
            ev.OnRedo += ev_OnRedo;
            // ev2.OnStartOperation += WorkspaceListener_OnStartOperation;
            //ev2.OnStopOperation += WorkspaceListener_OnStopOperation;
            //((IEditEvents_Event)editor).OnStartEditing += WorkspaceListener_OnStartEditing;
        }
        public AddPointSplitLine()
        {
            ConfigUtil.type = "gas";

            // Get the editor
            m_editor = ArcMap.Editor as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
        public ConnectClosestsConstructTool()
        {
            ConfigUtil.type = "gas";

            // Get the editor
            m_editor = ArcMap.Editor as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
 //            : base(hook)
 //            : base(hook, editor)
 /// <summary>
 /// Constructs a new FiberSpliceConfigHelper
 /// </summary>
 /// <param name="hook">Hook</param>
 /// <param name="editor">Editor</param>
 public FiberSpliceHelper(HookHelperExt hookHelper, IEditor3 editor)
 {
     _hookHelper = hookHelper;
     _editor = editor;
 }
        public AddLateralsFromMainPointConstructionTool()
        {
            ConfigUtil.type = "gas";

            // Get the editor
            m_editor = ArcMap.Editor as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
 //            : base(hook)
 //            : base(hook, editor)
 /// <summary>
 /// Constructs a new ConnectionEditorHelper
 /// </summary>
 /// <param name="hook">Hook</param>
 /// <param name="editor">Editor</param>
 public FiberDeviceConnectionHelper(HookHelperExt hookHelper, IEditor3 editor)
 {
     _hookHelper = hookHelper;
     _editor = editor;
 }
 public EditorBase(IEditor3 editor)
 {
     _editor = editor;
 }
 public AddPointSplitLine()
 {
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public AddLineWithEndPoints()
 {
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
        public void Shutdown()
        {
            // persist osm editor specific information like the osm base url, etc.
            OSMGPFactory.StoreOSMEditorSettings(m_editorConfigurationSettings);

            m_editEvents.OnDeleteFeature -= new IEditEvents_OnDeleteFeatureEventHandler(m_editEvents_OnDeleteFeature);
            m_editEvents.OnChangeFeature -= new IEditEvents_OnChangeFeatureEventHandler(m_editEvents_OnChangeFeature);
            m_editEvents.OnCreateFeature -= new IEditEvents_OnCreateFeatureEventHandler(m_editEvents_OnCreateFeature);
            m_editEvents.OnStartEditing -= new IEditEvents_OnStartEditingEventHandler(m_editEvents_OnStartEditing);

            m_editEvents2 = null;
            m_editEvents = null;
            m_editor3 = null;
            m_application = null;
        }
        // Overrides
        protected override void OnStartup()
        {
            s_extension = this;

            // Wire up events
            ArcMap.Events.NewDocument += ArcMap_NewOpenDocument;
            ArcMap.Events.OpenDocument += ArcMap_NewOpenDocument;

            //Listen for a Stop Edits Events to be fired
            //get the editor
            UID editorUid = new UID();
            editorUid.Value = "esriEditor.Editor";
            m_editor = ArcMap.Application.FindExtensionByCLSID(editorUid) as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;

            EnableEditListeners();
            _users = new List<iFormBuilderAPI.User>();
            Initialize();
        }
        public PointsAlongLineTool()
        {
            ConfigUtil.type = "gas";

            // Get the editor
            m_editor = ArcMap.Editor as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
 public PointsAlongLineTool()
 {
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
    public override void OnCreate(object hook)
    {
      if (hook == null)
        return;

      m_application = hook as IApplication;

      //get the editor
      UID editorUid = new UID();
      editorUid.Value = "esriEditor.Editor";
      m_editor = m_application.FindExtensionByCLSID(editorUid) as IEditor3;
    }
Ejemplo n.º 52
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            m_application = hook as IApplication;

            //get the editor
            UID editorUid = new UID();
            editorUid.Value = "esriEditor.Editor";
            m_editor = m_application.FindExtensionByCLSID(editorUid) as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
        public AddLineWithEndPoints()
        {
            ConfigUtil.configFileName = "gas.config";

            // Get the editor
            m_editor = ArcMap.Editor as IEditor3;
            m_editEvents = m_editor as IEditEvents_Event;
            m_editEvents5 = m_editor as IEditEvents5_Event;
        }
 public CreatePointAndRefPoint()
 {
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
 public ConnectClosestsConstructTool()
 {
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }
        public void Startup(ref object initializationData)
        {
            try
            {
                m_application = initializationData as IApplication;
                if (m_application == null)
                    return;

                ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass() as ISpatialReferenceFactory;
                m_wgs84 = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984) as ISpatialReference;

                //Get the editor.
                UID editorUid = new UID();
                editorUid.Value = "esriEditor.Editor";
                m_editor3 = m_application.FindExtensionByCLSID(editorUid) as IEditor3;
                m_editEvents2 = m_editor3 as IEditEvents2_Event;
                m_editEvents = m_editor3 as IEditEvents_Event;

                m_editEvents.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler(m_editEvents_OnCreateFeature);
                m_editEvents.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler(m_editEvents_OnChangeFeature);
                m_editEvents.OnDeleteFeature += new IEditEvents_OnDeleteFeatureEventHandler(m_editEvents_OnDeleteFeature);
                m_editEvents.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(m_editEvents_OnStartEditing);

                resourceManager = new ResourceManager("ESRI.ArcGIS.OSM.Editor.OSMFeatureInspectorStrings", this.GetType().Assembly);
                _osmUtility = new OSMClassExtension.OSMUtility();

                // retrtrieve osm editor specfic information
                m_editorConfigurationSettings = OSMGPFactory.ReadOSMEditorSettings();
            }
            catch { }
        }
 public AddLineWithEndPoints()
 {
     ConfigUtil.type = "water";
     // Get the editor
     m_editor = ArcMap.Editor as IEditor3;
     m_editEvents = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
 }