Exemple #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);
            }
        }
Exemple #2
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);
        }