Esempio n. 1
0
        private void 打开属性表ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ITable table = _toccSelectedLayer as ITable;

            if (table != null)
            {
                if (_attributeForm == null || _attributeForm.IsDisposed)
                {
                    _attributeForm = new AttributeForm();
                    _attributeForm.FeatureLocation += _attributeForm_FeatureLocation;
                }
                else
                {
                    _attributeForm.FeatureLocation -= _attributeForm_FeatureLocation;
                    _attributeForm.FeatureLocation += _attributeForm_FeatureLocation;
                    _attributeForm.Activate();//之前已打开,则给予焦点,置顶。
                }
                if (!_attributeForm.Visible)
                {
                    _attributeForm.Show(this);
                }

                IFeatureLayerDefinition featureLyrDef = _toccSelectedLayer as IFeatureLayerDefinition;
                string whereClause = featureLyrDef?.DefinitionExpression;
                _attributeForm.LoadAttribute(_toccSelectedLayer as IFeatureLayer, whereClause);
            }
        }
Esempio n. 2
0
        private void tsmiProperties1_Click(object sender, EventArgs e)
        {
            var lvwFiles = AllFiles;

            //显示属性窗口
            //右边窗体中没有文件/文件夹被选中
            if (lvwFiles.SelectedItems.Count == 0)
            {
                return;
            }
            //右边窗体中有文件/文件夹被选中
            else
            {
                try
                {
                    //显示被选中的第一个文件/文件夹的属性
                    AttributeForm attributeForm = new AttributeForm(lvwFiles.SelectedItems[0].Tag.ToString());
                    attributeForm.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Esempio n. 3
0
        private void 查询属性ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.mapViewer1.MainMapControl.LayerCount == 0)
            {
                return;
            }
            var form = new AttributeForm();

            form.LoadAttribute(this.mapViewer1.MainMapControl.GetLayers().First() as ITable);
            form.Show(this);
        }