Пример #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;
                }
            }
        }
        /*** Future Progress
         * private void OnActiveViewEventsItemAdded(System.Object Item)
         * {
         *  //MessageBox.Show("Item type is " + Item.GetType().ToString());
         * }
         *
         * private void OnActiveViewEventsItemDeleted(System.Object Item)
         * {
         *  //MessageBox.Show("Item type is " + Item.GetType().ToString());
         * }
         *
         * private void OnActiveViewEventsItemReordered(System.Object Item, System.Int32 toIndex)
         * {
         *  //MessageBox.Show("Item Type is " + Item.GetType().ToString() + "\nItem Index is " + toIndex);
         * }
         ***/

        #endregion

        #region Methods

        private void Initialize()
        {
            LoadFileTypeList();

            cbo_TileIndex.Items.Clear();
            cbo_TileIndex.Items.AddRange(_utilitiesArcMap.FeatureLayers("Polygon").Select(item => item.Name).ToArray());
            if (cbo_TileIndex.Items.Count > 0)
            {
                cbo_TileIndex.SelectedIndex = 0;
            }
            else
            {
                MessageBox.Show("Add A Polygon Layer to the Map", MB_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #3
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;
            }
        }
Пример #4
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;
            }
        }