zoukankan      html  css  js  c++  java
  • AO 获取系统自带的工具条

    备忘给自己看.

    如何调用系统自带的Editor编辑工具条,并打开Editor工具条。

    代码如下:ICommandBars commandBars = m_application.Document.CommandBars;

    UID barID = new ESRI.ArcGIS.esriSystem.UIDClass();
    barID.Value = "esriEditor.EditorToolBar";// Example: "esriArcMapUI.StandardToolBar"
    //得到Editor工具条
    ICommandItem barItem = commandBars.Find(barID, false, false);
    if (barItem != null && barItem.Type == esriCommandTypes.esriCmdTypeToolbar)
    {
      ESRI.ArcGIS.Framework.ICommandBar commandBar = (ESRI.ArcGIS.Framework.ICommandBar)barItem;
       //打开Editor工具条
       commandBar.Dock(esriDockFlags.esriDockShow, null);
    IEngineEditLayers editLayers = editor as IEngineEditLayers;
      IFeatureLayer featureLayer = waterLayer as IFeatureLayer;
      IDataset dataset = featureLayer.FeatureClass as IDataset;
      IWorkspace workspace = dataset.Workspace;

      UID editorID = new UIDClass();
      editorID.Value = "esriEditor.Editor";
      IEditor editor = m_application.FindExtensionByCLSID(editorID) as IEditor;
        if (editor != null)
      {
        editor.StartEditing(workspace);
      }
      else
      {
        MessageBox.Show("不可编辑,请确认图层没有被其它程序打开。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
      }
    }
  • 相关阅读:
    单调栈问题解析
    Linux进程状态切换
    Shell编程小例子
    Linux之shell编程
    树的遍历框架
    你真的会求1-100有多少个素数吗
    java实现LRU算法
    从上到下打印二叉树 III
    从上到下打印二叉树I
    模拟盘电路板调试过程中出现的问题
  • 原文地址:https://www.cnblogs.com/suixinge/p/3519017.html
Copyright © 2011-2022 走看看