Exemple #1
0
        private void basicLineLayerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TabPage          page   = new TabPage("线");
            IBasicLineSymbol symbol = new BasicLineSymbolClass();

            this.m_pRepresentationRule.InsertLayer(this.m_pRepresentationRule.LayerCount, symbol as IBasicSymbol);
            BasicLineSymbolLayer layer = new BasicLineSymbolLayer
            {
                GeometryType = this.m_pRepresentationRuleItem.GeometryType,
                BasicSymbol  = symbol as IBasicSymbol
            };

            page.Controls.Add(layer);
            layer.Dock = DockStyle.Fill;
            this.tabControl1.TabPages.Add(page);
        }
Exemple #2
0
 private void RepresationRuleCtrl_Load(object sender, EventArgs e)
 {
     this.contextMenuStrip1.Items.Clear();
     if (this.m_pRepresentationRuleItem != null)
     {
         this.symbolItem1.Symbol = this.m_pRepresentationRuleItem;
     }
     if (this.m_pRepresentationRule != null)
     {
         for (int i = 0; i < this.m_pRepresentationRule.LayerCount; i++)
         {
             TabPage      page;
             IBasicSymbol symbol = this.m_pRepresentationRule.get_Layer(i);
             if (symbol is IBasicMarkerSymbol)
             {
                 this.contextMenuStrip1.Items.Add(this.basicMarkerLayerToolStripMenuItem);
                 page = new TabPage("点");
                 BasicMarkerSymbolLayer layer = new BasicMarkerSymbolLayer
                 {
                     BasicSymbol  = symbol,
                     GeometryType = this.m_pRepresentationRuleItem.GeometryType
                 };
                 page.Controls.Add(layer);
                 layer.Dock = DockStyle.Fill;
                 this.tabControl1.TabPages.Add(page);
             }
             else if (symbol is IBasicLineSymbol)
             {
                 this.contextMenuStrip1.Items.Add(this.basicMarkerLayerToolStripMenuItem);
                 this.contextMenuStrip1.Items.Add(this.basicLineLayerToolStripMenuItem);
                 page = new TabPage("线");
                 BasicLineSymbolLayer layer2 = new BasicLineSymbolLayer
                 {
                     BasicSymbol  = symbol,
                     GeometryType = this.m_pRepresentationRuleItem.GeometryType
                 };
                 page.Controls.Add(layer2);
                 layer2.Dock = DockStyle.Fill;
                 this.tabControl1.TabPages.Add(page);
             }
             else if (symbol is IBasicFillSymbol)
             {
                 this.contextMenuStrip1.Items.Add(this.basicMarkerLayerToolStripMenuItem);
                 this.contextMenuStrip1.Items.Add(this.basicLineLayerToolStripMenuItem);
                 this.contextMenuStrip1.Items.Add(this.basicFillLayerToolStripMenuItem);
                 page = new TabPage("面");
                 BasicFillSymbolLayer layer3 = new BasicFillSymbolLayer
                 {
                     BasicSymbol  = symbol,
                     GeometryType = this.m_pRepresentationRuleItem.GeometryType
                 };
                 page.Controls.Add(layer3);
                 layer3.Dock = DockStyle.Fill;
                 this.tabControl1.TabPages.Add(page);
             }
         }
     }
     this.btnAddLayer.Enabled    = this.m_CanEdit;
     this.btnDeleteLayer.Enabled = this.m_CanEdit;
     this.btnMoveUp.Enabled      = this.m_CanEdit;
     this.tnMoveDown.Enabled     = this.m_CanEdit;
 }
Exemple #3
0
        public void Init()
        {
            int num;

            this.contextMenuStrip1.Items.Clear();
            for (num = this.tabControl1.TabCount - 1; num > 0; num--)
            {
                this.tabControl1.TabPages.RemoveAt(num);
            }
            this.symbolItem1.Symbol = this.m_pRepresentationRuleItem;
            if (this.m_pRepresentationRule != null)
            {
                for (num = 0; num < this.m_pRepresentationRule.LayerCount; num++)
                {
                    TabPage      page;
                    IBasicSymbol symbol = this.m_pRepresentationRule.get_Layer(num);
                    if (symbol is IBasicMarkerSymbol)
                    {
                        this.contextMenuStrip1.Items.Add(this.basicMarkerLayerToolStripMenuItem);
                        page = new TabPage("点");
                        BasicMarkerSymbolLayer layer = new BasicMarkerSymbolLayer
                        {
                            BasicSymbol  = symbol,
                            GeometryType = this.m_pRepresentationRuleItem.GeometryType
                        };
                        page.Controls.Add(layer);
                        layer.Dock = DockStyle.Fill;
                        this.tabControl1.TabPages.Add(page);
                    }
                    else if (symbol is IBasicLineSymbol)
                    {
                        this.contextMenuStrip1.Items.Add(this.basicMarkerLayerToolStripMenuItem);
                        this.contextMenuStrip1.Items.Add(this.basicLineLayerToolStripMenuItem);
                        page = new TabPage("线");
                        BasicLineSymbolLayer layer2 = new BasicLineSymbolLayer
                        {
                            BasicSymbol  = symbol,
                            GeometryType = this.m_pRepresentationRuleItem.GeometryType
                        };
                        page.Controls.Add(layer2);
                        layer2.Dock = DockStyle.Fill;
                        this.tabControl1.TabPages.Add(page);
                    }
                    else if (symbol is IBasicFillSymbol)
                    {
                        this.contextMenuStrip1.Items.Add(this.basicMarkerLayerToolStripMenuItem);
                        this.contextMenuStrip1.Items.Add(this.basicLineLayerToolStripMenuItem);
                        this.contextMenuStrip1.Items.Add(this.basicFillLayerToolStripMenuItem);
                        page = new TabPage("面");
                        BasicFillSymbolLayer layer3 = new BasicFillSymbolLayer
                        {
                            BasicSymbol  = symbol,
                            GeometryType = this.m_pRepresentationRuleItem.GeometryType
                        };
                        page.Controls.Add(layer3);
                        layer3.Dock = DockStyle.Fill;
                        this.tabControl1.TabPages.Add(page);
                    }
                }
            }
            this.btnAddLayer.Enabled    = this.m_CanEdit;
            this.btnDeleteLayer.Enabled = this.m_CanEdit;
            this.btnMoveUp.Enabled      = this.m_CanEdit;
            this.tnMoveDown.Enabled     = this.m_CanEdit;
        }