clsPasterFeatures.cs
上传用户:tjyyhj
上传日期:2022-07-18
资源大小:30840k
文件大小:2k
源码类别:

GIS编程

开发平台:

Visual C++

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using ESRI.ArcGIS.SystemUI;
  5. using ESRI.ArcGIS.Carto;
  6. using ESRI.ArcGIS.Controls;
  7. using ESRI.ArcGIS.Geometry;
  8. using ESRI.ArcGIS.Geodatabase;
  9. using GisFramework;
  10. namespace Genaric
  11. {
  12.     public class clsPasterFeatures : ICommand 
  13.     {
  14.         private IApplication mApp = null;
  15.         #region ICommand 成员
  16.         public int Bitmap
  17.         {
  18.             get {   return -1; }
  19.         }
  20.         public string Caption
  21.         {
  22.             get { return "粘贴"; }
  23.         }
  24.         public string Category
  25.         {
  26.             get { return "基本操作"; }
  27.         }
  28.         public bool Checked
  29.         {
  30.             get { return false; }
  31.         }
  32.         public bool Enabled
  33.         {
  34.             get { return true; }
  35.         }
  36.         public int HelpContextID
  37.         {
  38.             get { throw new Exception("The method or operation is not implemented."); }
  39.         }
  40.         public string HelpFile
  41.         {
  42.             get { throw new Exception("The method or operation is not implemented."); }
  43.         }
  44.         public string Message
  45.         {
  46.             get { return "执行粘贴操作"; }
  47.         }
  48.         public string Name
  49.         {
  50.             get { return "Paster Features"; }
  51.         }
  52.         public void OnClick()
  53.         {
  54.             if (mApp.Editor.EditState == esriEngineEditState.esriEngineStateNotEditing)
  55.             {
  56.                 System.Windows.Forms.MessageBox.Show("请先开启编辑!", "提示",
  57.                     System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
  58.                 return;
  59.             }
  60.             try
  61.             {
  62.                 ICommand pmc = new ControlsEditingPasteCommandClass();
  63.                 pmc.OnCreate(mApp.MapControl);
  64.                 pmc.OnClick();       
  65.             }
  66.             catch { }
  67.         }
  68.         public void OnCreate(object hook)
  69.         {
  70.             mApp = hook as IApplication;  
  71.         }
  72.         public string Tooltip
  73.         {
  74.             get {
  75.                 return "执行粘贴操作";
  76.             }
  77.         }
  78.         #endregion
  79.  
  80.     }
  81. }