Exemplo n.º 1
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;
                }
            }
        }
        //private ESRI.ArcGIS.Carto.IActiveViewEvents_ItemAddedEventHandler _itemAddedEventHandler;
        //private ESRI.ArcGIS.Carto.IActiveViewEvents_ItemDeletedEventHandler _itemDeletedEventHandler;
        //private ESRI.ArcGIS.Carto.IActiveViewEvents_ItemReorderedEventHandler _itemReorderedEventHandler;

        #endregion

        #region Constructor

        public FileTileLoader_Form(IApplication application)
        {
            InitializeComponent();

            // Get Standard Players
            _application     = application;
            _mxdocument      = (IMxDocument)_application.Document;
            _map             = _mxdocument.FocusMap;
            _utilitiesArcMap = new Utilities_ArcMap(_map);

            // Add Methods To Delegates

            //_itemAddedEventHandler = new IActiveViewEvents_ItemAddedEventHandler(OnActiveViewEventsItemAdded);
            //_itemDeletedEventHandler = new IActiveViewEvents_ItemDeletedEventHandler(OnActiveViewEventsItemDeleted);
            //_itemReorderedEventHandler = new IActiveViewEvents_ItemReorderedEventHandler(OnActiveViewEventsItemReordered);

            // Setup Event Delegates
            //IActiveViewEvents_Event activeViewEvents = _map as IActiveViewEvents_Event;

            //activeViewEvents.ItemAdded += _itemAddedEventHandler;
            //activeViewEvents.ItemDeleted += _itemDeletedEventHandler;
            //activeViewEvents.ItemReordered += _itemReorderedEventHandler;


            // Setup Save Folder Path
            _saveFolder   = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"RS_Tools\ArcMap\FileTileLoader");
            _saveFullPath = System.IO.Path.Combine(_saveFolder, _saveFile);
        }
 private void GetStandardPlayers()
 {
     _application     = ArcMap.Application;
     _mxdocument      = (IMxDocument)_application.Document;
     _map             = _mxdocument.FocusMap;
     _utilitiesArcMap = new Utilities_ArcMap(_map);
     _editor          = _utilitiesArcMap.GetEditorFromArcMap((IMxApplication)_application);
 }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public Homesite(IApplication application)
        {
            _application     = application;
            _mxdocument      = (IMxDocument)_application.Document;
            _map             = _mxdocument.FocusMap;
            _activeView      = _mxdocument.ActiveView;
            _utilitiesArcMap = new RS_Tools.Utilities.Utilities_ArcMap(_map);

            InitializeComponent();
        }
Exemplo n.º 6
0
        public FileTileCloner_Form(IApplication application)
        {
            InitializeComponent();

            // Get Standard Players
            _application     = application;
            _mxdocument      = (IMxDocument)_application.Document;
            _map             = _mxdocument.FocusMap;
            _utilitiesArcMap = new Utilities_ArcMap(_map);

            _saveFolder   = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"RS_Tools\ArcMap\FileTileCloner");
            _saveFullPath = System.IO.Path.Combine(_saveFolder, _saveFile);
        }
Exemplo n.º 7
0
 private void Initialize()
 {
     _mxdocument      = (IMxDocument)_application.Document;
     _map             = _mxdocument.FocusMap;
     _utilitiesArcMap = new RS_Tools.Utilities.Utilities_ArcMap(_map);
     cboTileIndex.Items.Clear();
     cboTileIndex.Items.AddRange(_utilitiesArcMap.PolygonLayerNames().ToArray());
     if (cboTileIndex.Items.Count > 0)
     {
         cboTileIndex.SelectedIndex = 0;
     }
     else
     {
         MessageBox.Show("Add Some Polygon Layers to Arcmap", MB_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Exemplo n.º 8
0
        private void Initialize()
        {
            _mxdocument = (IMxDocument)_application.Document;
            _map        = _mxdocument.FocusMap;
            _activeView = _mxdocument.ActivatedView;

            _utilitiesArcMap = new RS_Tools.Utilities.Utilities_ArcMap(_map);

            if (this.cbo_FeatureLayers.Items.Count > 0)
            {
                this.cbo_FeatureLayers.Items.Clear();
            }
            cbo_FeatureLayers.Items.AddRange(_utilitiesArcMap.FeatureLayers().Select(item => item.Name).ToArray());
            if (this.cbo_FeatureLayers.Items.Count > 0)
            {
                this.cbo_FeatureLayers.SelectedIndex = 0;
            }
        }
Exemplo n.º 9
0
        private void Initialize()
        {
            _application = Hook as IApplication;
            _mxdocument  = (IMxDocument)_application.Document;
            _map         = _mxdocument.FocusMap;
            _activeView  = _mxdocument.ActivatedView;

            _utilities = new Utilities_ArcMap(_map);

            cboFeatureLayer.Items.Clear();
            cboField.Items.Clear();

            cboFeatureLayer.Items.AddRange(_utilities.FeatureLayers().Select(item => item.Name).ToArray());

            if (cboFeatureLayer.Items.Count > 0)
            {
                cboFeatureLayer.SelectedIndex = 0;
            }
        }
Exemplo n.º 10
0
        private void Initialize()
        {
            _application = this.Hook as IApplication;
            _mxdocument  = (IMxDocument)_application.Document;
            _map         = _mxdocument.FocusMap;
            _activeView  = _mxdocument.ActiveView;

            _utilitiesArcMap = new RS_Tools.Utilities.Utilities_ArcMap(_map);
            if (this.cboBuildingLayer.Items.Count > 0)
            {
                this.cboBuildingLayer.Items.Clear();
            }
            this.cboBuildingLayer.Items.AddRange(_utilitiesArcMap.PolygonLayerNames().ToArray());
            this.cboBuildingLayer.Items.AddRange(_utilitiesArcMap.PolylineLayers().ToArray());
            this.cboBuildingLayer.Items.AddRange(_utilitiesArcMap.PointLayerNames().ToArray());
            if (this.cboBuildingLayer.Items.Count > 0)
            {
                this.cboBuildingLayer.SelectedIndex = 0;
            }
        }
Exemplo n.º 11
0
        private bool CheckRequirements()
        {
            try
            {
                if (_utilitiesArcmap == null)
                {
                    _mxdocument = (IMxDocument)_application.Document;
                    _map        = _mxdocument.FocusMap;
                    _activeView = _mxdocument.ActiveView;
                    if (_utilitiesArcmap == null)
                    {
                        _utilitiesArcmap = new Utilities_ArcMap(_map);
                    }
                }

                if (this.cboTargetLayer.Items.Count == 0)
                {
                    return(false);
                }



                if (_editor == null)
                {
                    return(false);
                }

                if (_editor.EditState != esriEditState.esriStateEditing)
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
            return(true);
        }
Exemplo n.º 12
0
        private void TileOrganizer_Form_Load(object sender, EventArgs e)
        {
            this.lblVersion.Text = "Version: " + this.ProductVersion;

            _mxdocument = (IMxDocument)_application.Document;
            _map        = _mxdocument.FocusMap;
            _activeView = _mxdocument.ActiveView;

            if (_utilities == null)
            {
                _utilities = new Utilities_ArcMap(_map);
            }

            this.cboTileLayoutLayer.Items.AddRange(_utilities.PolygonLayerNames().ToArray());
            if (this.cboTileLayoutLayer.Items.Count > 0)
            {
                this.cboTileLayoutLayer.SelectedIndex = 0;
            }

            this.tbxLASFolder.Text      = _util.LASFOLDER;
            this.tbxLASToolsFolder.Text = _util.LASTOOLSFOLDER;
            this.numProcesses.Value     = _util.PROCESSES;
        }
Exemplo n.º 13
0
        private bool CheckRequirements()
        {
            if (!groupCorner.Controls.OfType <RadioButton>().Any(x => x.Checked))
            {
                MessageBox.Show("Select A Corner", MB_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }
            if (!groupDirection.Controls.OfType <RadioButton>().Any(x => x.Checked))
            {
                MessageBox.Show("Select A Direction", MB_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }
            try
            {
                if (_utilitiesArcMap == null)
                {
                    _mxdocument = (IMxDocument)_application.Document;
                    _map        = _mxdocument.FocusMap;
                    _activeView = _mxdocument.ActiveView;
                    if (_utilitiesArcMap == null)
                    {
                        _utilitiesArcMap = new Utilities_ArcMap(_map);
                    }
                }

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

                IFeatureLayer featureLayer = _utilitiesArcMap.FeatureLayer((cbo_FeatureLayers.Text));
                if (featureLayer == null)
                {
                    MessageBox.Show("Feature Layer Failed To Load", MB_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }

                IFeatureClass featureClass = featureLayer.FeatureClass;
                if (featureClass == null)
                {
                    MessageBox.Show("Feature Class Failed To Load", MB_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }


                ILayer layer = _utilitiesArcMap.Layer(this.cbo_FeatureLayers.Text);
                int    inspectionfieldindex = _utilitiesArcMap.FindField(layer, "rsi_index");
                if (inspectionfieldindex < 0)
                {
                    MessageBox.Show("Add 'rsi_index' field, short integer!", MB_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return(false);
                }

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

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

            return(true);
        }
Exemplo n.º 14
0
 public BoundaryProblem(IApplication application, Utilities_ArcMap utilities)
 {
     _application = application;
     _utilities   = utilities;
 }