Beispiel #1
0
        private void treeView1_DoubleClick(object sender, EventArgs e)
        {
            //MessageBox.Show("hh");
            SpatialAnalysis sa = new SpatialAnalysis();
            IGeometry g = sa.buffer(Global.ifeature, 100);

            Datamanagement dm = new Datamanagement();
            dm.showGraphics(g);
        }
Beispiel #2
0
        private void axTOCControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.ITOCControlEvents_OnMouseDownEvent e)
        {
            if (e.button == 2)
            {
                //判断所选菜单的类型
                axTOCControl1.HitTest(e.x, e.y, ref pTocItem, ref pMap, ref pLayer, ref pother, ref pindex);
                //axMapControl1.CustomProperty = layer;

                //弹出右键菜单
                /*if (item == esriTOCControlItem.esriTOCControlItemMap)
                    pMenuMap.PopupMenu(e.x, e.y, m_tocControl.hWnd);
                if (item == esriTOCControlItem.esriTOCControlItemLayer)
                    pMenuLayer.PopupMenu(e.x, e.y, m_tocControl.hWnd);*/
                //菜单的创建
                //pMenuMap = new ToolbarMenuClass();
                //pMenuLayer = new ContextMenuStrip();
                if (pTocItem == esriTOCControlItem.esriTOCControlItemLayer)
                {
                    //pFLayer = pLayer as IFeatureLayer;
                    //pFC = pFLayer.FeatureClass;

                    //pFeatureLayer = pLayer as IFeatureLayer;
                    /*   pfeatureclass = pFeatureLayer.FeatureClass;
                       SymbolToolStripMenuItem.DropDownItems.Clear();
                       for (int i = 0; i < pfeatureclass.Fields.FieldCount; i++)
                       {
                           SymbolToolStripMenuItem.DropDownItems.Add(pfeatureclass.Fields.get_Field(i).Name, null, new EventHandler(this.symbolshow_Clicked)); }
                
                   */
                    //toolStripMenuItem2.Click +=toolStripMenuItem2_Click;
                    Datamanagement dm = new Datamanagement();
                    dm.addContextmenu(contextMenuStrip1);

                    contextMenuStrip1.Show(axTOCControl1, new System.Drawing.Point(e.x, e.y));

                    //m_menuLayer.AddItem(new frmAttribute(axMapControl1, pLayer), -1, 2, true, esriCommandStyles.esriCommandStyleTextOnly);

                    //m_menuLayer = new ToolbarMenuClass();
                    //m_menuLayer.AddItem(new OpenAttributeTable(pLayer), -1, 0, true, esriCommandStyles.esriCommandStyleTextOnly);
                    //动态添加图层标注的Command到图层右键菜单
                    //m_menuLayer.AddItem(new LabelLayerCmd(pLayer, m_mapControl), -1, 1, false, esriCommandStyles.esriCommandStyleTextOnly);
                    //m_menuLayer.AddItem(new LabelLayerCmd(pLayer), -1, 1, false, esriCommandStyles.esriCommandStyleTextOnly);

                    //弹出图层右键菜单m_mapControl
                    //m_menuLayer.SetHook(m_mapControl);
                    //m_menuLayer.PopupMenu(e.x, e.y, axTOCControl1.hWnd);
                    // 注意顺序不能颠倒
                    //m_menuLayer.Remove(1);
                    //m_menuLayer.Remove(0)
                };
            }
        }
Beispiel #3
0
 private void 添加字段ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Datamanagement dt = new Datamanagement();
     dt.addField("test","string");
 }
Beispiel #4
0
 private void axMapControl1_OnAfterScreenDraw(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnAfterScreenDrawEvent e)
 {
     Datamanagement dt = new Datamanagement();
     dt.copyToPageLayout();
 }