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);
      }
    }
  • 相关阅读:
    deepcopy list,dict
    朴素贝叶斯
    COMP6714 week2a skipTo()
    batch normalization / layer normalization
    self-attention Transformer
    44. 通配符匹配
    FOJ 10月赛题 FOJ2198~2204
    CF #323 DIV2 D题
    HDU 5467
    CF #321 (Div. 2) E
  • 原文地址:https://www.cnblogs.com/suixinge/p/3519017.html
Copyright © 2011-2022 走看看