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);
      }
    }
  • 相关阅读:
    ArrayList用法
    MessageBox
    将文本文件导入Sql数据库
    在桌面和菜单中添加快捷方式
    泡沫排序
    Making use of localized variables in javascript.
    Remove double empty lines in Visual Studio 2012
    Using Operations Manager Connectors
    Clear SharePoint Designer cache
    Programmatically set navigation settings in SharePoint 2013
  • 原文地址:https://www.cnblogs.com/suixinge/p/3519017.html
Copyright © 2011-2022 走看看