//创建事件响应函数
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
                m_hookHelper = new HookHelperClass();

            m_hookHelper.Hook = hook;
        }
Esempio n. 2
0
        public MeasureDisTool(IHookHelper m_hookHelper0)
        {
            if (m_hookHelper0 != null)
            {
                m_hookHelper = m_hookHelper0;
            }
            else
            {
                return;
            }
            //
            // TODO: Define values for the public properties
            //
            base.m_category = ""; //localizable text
            base.m_caption = "measure";  //localizable text
            base.m_message = "This should work in ArcMap/MapControl/PageLayoutControl";  //localizable text
            base.m_toolTip = "量测";  //localizable text
            base.m_name = "measure";   //unique id, non-localizable (e.g. "MyCategory_MyTool")
            //frm = new FrmMeasure(m_hookHelper);
            m_Cursor = System.Windows.Forms.Cursors.Cross;

            try
            {
                //
                // TODO: change resource name if necessary
                //
                string bitmapResourceName = GetType().Name + ".bmp";
                base.m_bitmap = new Bitmap(GetType(), bitmapResourceName);
                base.m_cursor = new System.Windows.Forms.Cursor(GetType(), GetType().Name + ".cur");
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");
            }
        }
Esempio n. 3
0
        public FormAggregation(IHookHelper hook)
        {
            InitializeComponent();
            _hookHelper = hook;

            this.Load += new EventHandler(FormPolygonAggregation_Load);
        }
Esempio n. 4
0
        public Tend(IHookHelper hookHelper,AxMapControl amap)
        {
            this.axmapcontrol = amap;

            this.m_hookHelper = hookHelper;
            InitializeComponent();
        }
Esempio n. 5
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;

            pPageLayoutControl = m_hookHelper.Hook as IPageLayoutControl3;
            IPageLayout pPageLayout = pPageLayoutControl.PageLayout;
            // TODO:  Add other initialization code
        }
Esempio n. 6
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;

            m_ClipMap = new MapClass();

            // TODO:  Add other initialization code
        }
        /// <summary>
        /// ��������
        /// </summary>
        /// <params name="hook">����ʵ��</params>
        public override void OnCreate(object hook)
        {
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;

            //��ʼ������
            m_map = m_hookHelper.FocusMap;
            m_pActiveView = m_hookHelper.ActiveView;
        }
 public MeasureResult(IHookHelper myhookhelper)
 {
     InitializeComponent();
     //measureDistance.MsgInfo = this;
     m_HookHelper = myhookhelper;
     GetMapUnit();
     //esriAreaUnits.esriSquareMeters
 }
    public OpenSimplePointDlg(IHookHelper hookHelper)
    {
      if (null == hookHelper)
        throw new Exception("Hook helper is not initialize");

      InitializeComponent();
      
      m_hookHelper = hookHelper;
    }
Esempio n. 10
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
                m_hookHelper = new HookHelperClass();

            m_hookHelper.Hook = hook;

            // TODO:  Add Tool1.OnCreate implementation
        }
        public OGRAddLayerDialog(IHookHelper hookHelper)
        {
            if (null == hookHelper)
                throw new Exception("Hook helper is not initialized");

            InitializeComponent();

            m_hookHelper = hookHelper;
        }
Esempio n. 12
0
        public OpenSimplePointDlg(IHookHelper hookHelper)
        {
            if (null == hookHelper)
            {
                throw new Exception("Hook helper is not initialize");
            }

            InitializeComponent();

            m_hookHelper = hookHelper;
        }
Esempio n. 13
0
        public FrmLegend(string [] symbolstyle, IHookHelper hookHelper)
        {
            InitializeComponent();
            this.EnableGlass = false;
            m_hookHelper     = hookHelper;
            SymbolStyle      = symbolstyle;
            pActiveView      = m_hookHelper.PageLayout as IActiveView;
            pMap             = pActiveView.FocusMap;

            pSelectedidx = new List <int>();
        }
Esempio n. 14
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (hook == null)
            {
                return;
            }

            m_hookHelper = new HookHelperClass {
                Hook = hook
            };
        }
Esempio n. 15
0
 //创建Tool,初始化变量
 public override void OnCreate(object hook)
 {
     if (m_HookHelper == null)
     {
         m_HookHelper = new HookHelperClass();
     }
     m_HookHelper.Hook = hook;
     m_Map             = m_HookHelper.FocusMap;
     m_ActiveView      = m_HookHelper.ActiveView;
     m_ScreenDisplay   = m_ActiveView.ScreenDisplay;
 }
Esempio n. 16
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;

            // TODO:  Add CommandCurentExport.OnCreate implementation
        }
Esempio n. 17
0
        public OGRAddLayerDialog(IHookHelper hookHelper)
        {
            if (null == hookHelper)
            {
                throw new Exception("Hook helper is not initialized");
            }

            InitializeComponent();

            m_hookHelper = hookHelper;
        }
Esempio n. 18
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_pHookHelper == null)
            {
                m_pHookHelper = new HookHelperClass();
            }

            m_pHookHelper.Hook = hook;

            // TODO:  Add RSSLayerProperties.OnCreate implementation
        }
Esempio n. 19
0
 public override void OnCreate(object hook)
 {
     if (hook != null)
     {
         if (this.m_hookHelper == null)
         {
             this.m_hookHelper = new HookHelperClass();
         }
         this.m_hookHelper.Hook = hook;
     }
 }
Esempio n. 20
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;

            // TODO:  Add CmdSetDefaultElemetStyle.OnCreate implementation
        }
Esempio n. 21
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;

            // TODO:  Add ToolRasterEdit.OnCreate implementation
        }
Esempio n. 22
0
 public override void OnCreate(object hook)
 {
     base.OnCreate(hook);
     if (hook == null)
     {
         return;
     }
     m_hookHelper      = new HookHelperClass();
     m_hookHelper.Hook = hook;
     mapcontrol        = m_hookHelper.Hook as IMapControlDefault;
 }
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            //Instantiate the hook helper
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            //set the hook
            m_hookHelper.Hook = hook;
        }
Esempio n. 24
0
 //以下2个变量用于设置要素属性的显示与打印,displaySelectedFeatures变量设置为true时,
 //仅对要素的选择集有效; 否则对所有要素有效。
 //displayViaReport变量设置为true时,以报表方式显示或打印要素属性;
 //否则,以普通的属性表方式显示要素的属性
 public BufferAnalysis(IHookHelper hookHelper)
 {
     InitializeComponent();
     if (hookHelper == null)
     {
         return;
     }
     m_hookHelper = hookHelper;
     m_activeView = m_hookHelper.ActiveView;
     m_map        = m_hookHelper.FocusMap;
 }
Esempio n. 25
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;

            // TODO:  Add FixedZoomIn.OnCreate implementation
        }
Esempio n. 26
0
 public override void OnCreate(object hook)
 {
     if (m_pHookHelper == null)
     {
         m_pHookHelper = new HookHelperClass();
     }
     m_pHookHelper.Hook = hook;
     m_MapControl       = hook as IMapControlDefault;//xisheng 20111117 传递m_MapControl以便刷新
     m_pMap             = m_pHookHelper.FocusMap;
     m_pActiveView      = m_pHookHelper.ActiveView;
     //m_pLayer = m_pMap.get_Layer(0);
 }
Esempio n. 27
0
                /// <summary>
                /// Occurs when this command is created
                /// </summary>
                /// <param name="hook">Instance of the application</param>
                public override void OnCreate(object hook)
               
        {
                        if (m_hookHelper == null)
            {
                                m_hookHelper = new HookHelperClass();
            }

                        m_hookHelper.Hook = hook;

                   
        }
Esempio n. 28
0
        /// <summary>

        /// Occurs when this command is created

        /// </summary>

        /// <param name="hook">Instance of the application</param>

        public override void OnCreate(object hook)

        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }



            m_hookHelper.Hook = hook;
        }
Esempio n. 29
0
 public UpStreamTrace()
 {
     //
     // TODO: �ڴ˴���ӹ��캯���߼�
     //
     m_HookHelper=new HookHelperClass();
     base.m_caption = "���ݷ���";
     base.m_category = "CustomCommands";
     base.m_message = "�������";
     base.m_name = "CustomCommands_sloverPath";
     base.m_toolTip = "���ݷ���";
 }
Esempio n. 30
0
 public override void OnCreate(object hook)
 {
     if (m_hookHelper == null)
     {
         m_hookHelper = new HookHelperClass();
     }
     myHook = hook as Plugin.Application.IAppFormRef;
     Plugin.Application.IAppArcGISRef HookGis = hook as Plugin.Application.IAppArcGISRef;
     smpdHook          = hook as Plugin.Application.IAppGISRef;
     m_hookHelper.Hook = HookGis.MapControl;
     m_MapControl      = HookGis.MapControl as IMapControlDefault;
 }
Esempio n. 31
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (hook == null)
                return;

            if (m_hookHelper == null)
                m_hookHelper = new HookHelperClass();

            m_hookHelper.Hook = hook;

            // TODO:  Add other initialization code
        }
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;
            m_MapControl      = hook as IMapControlDefault;

            m_enumQueryMode = enumQueryMode.Top;
        }
Esempio n. 33
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;
            m_MapControl      = hook as IMapControlDefault;
            m_pActiveView     = m_hookHelper.FocusMap as IActiveView;
            // TODO:  Add ToolAreaStatistics.OnCreate implementation
        }
Esempio n. 34
0
 public UpStreamTrace()
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     m_HookHelper    = new HookHelperClass();
     base.m_caption  = "上溯分析";
     base.m_category = "CustomCommands";
     base.m_message  = "网络分析";
     base.m_name     = "CustomCommands_sloverPath";
     base.m_toolTip  = "上溯分析";
 }
Esempio n. 35
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;
            frmAdjPoint       = new frmAdjustPoint(m_geoRef, m_hookHelper.ActiveView, m_hookHelper.FocusMap, m_fileName);
            frmAdjPoint.Show();
            // TODO:  Add SelectPoint.OnCreate implementation
        }
Esempio n. 36
0
 public override void OnCreate(object hook)
 {
     if (this.m_hookHelper == null)
     {
         this.m_hookHelper = new HookHelperClass();
     }
     this.m_hookHelper.Hook = hook;
     this.m_tool            = new ControlsEditingSketchToolClass();
     this.m_command         = (ICommand)this.m_tool;
     this.m_command.OnCreate(hook);
     this._cursor = this.m_tool.Cursor;
 }
Esempio n. 37
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            m_hookHelper      = new HookHelperClass();
            m_hookHelper.Hook = hook;
            m_activeView      = m_hookHelper.ActiveView;
            m_map             = m_hookHelper.FocusMap;
            m_firstPoint      = new PointClass();
            m_secondPoint     = new PointClass();
            m_activePoint     = new PointClass();

            // TODO:  Add TrimPloylineTool.OnCreate implementation
        }
Esempio n. 38
0
        public moveFeatureTool()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
            base.m_caption  = "移动要素";
            base.m_category = "CustomCommands";
            base.m_message  = "MoveFeature";
            base.m_name     = "CustomCommands_identify";
            base.m_toolTip  = "移动要素";

            m_HookHelper = new HookHelperClass();
        }
Esempio n. 39
0
        //记录当前比例尺属性,用于取消时返回
        //double pOriDivision = 0;
        //double pOriSubDivision = 0;
        //double pOriUnit = 0;
        //double pOriUnitPos = 0;
        //ITextSymbol pOriUnitSymbol = null;
        //double pOriUnitGap = 0;
        //double pOriFre = 0;
        //double pOriFrePos = 0;
        //ITextSymbol pOriFreSymbol = null;
        //double pOriFreGap = 0;
        //double pOriBarSize = 0;
        //IRgbColor pOriBarcolor = null;
        //属性调用构造器
        public FrmScaleBarAttribute(string[] symbolstyle, IElement element, IGraphicsContainer graphicscontainer, IHookHelper hookhelper)
        {
            InitializeComponent();
            SymbolStyle        = symbolstyle;
            pElement           = element;
            pGraphicsContainer = graphicscontainer;
            m_hookHelper       = hookhelper;

            pMapSurroundFrame = (IMapSurroundFrame)pElement;
            ScaleBar          = pMapSurroundFrame.MapSurround as IScaleBar;

            FrmIndex = 2;
        }
Esempio n. 40
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;
            m_MapControl      = hook as IMapControlDefault;

            //m_enumAttributeEditMode = enumAttributeEditMode.Top;
            //m_enumAttributeEditMode = enumAttributeEditMode.CurEdit; //changed by chulili 2011-04-15 默认当前编辑图层
        }
 /// <summary>
 /// Occurs when this command is created
 /// </summary>
 /// <param name="hook">Instance of the application</param>
 public override void OnCreate(object hook)
 {
     if (hook == null)
     {
         return;
     }
     if (m_hookHelper == null)
     {
         m_hookHelper = new HookHelperClass();
     }
     m_hookHelper.Hook = hook;
     m_mapControl      = hook as IMapControl3;
 }
Esempio n. 42
0
 public override void OnCreate(object hook)
 {
     try
     {
         m_hookHelper      = new HookHelperClass();
         m_hookHelper.Hook = hook;
         m_enabled         = true;
     }
     catch
     {
         m_hookHelper = null;
     }
 }
Esempio n. 43
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;
            m_MapControl      = hook as IMapControlDefault;
            //m_pActiveViewEvents = m_MapControl.ActiveView  as IActiveViewEvents_Event;
            m_enumQueryMode = enumQueryMode.Visiable; //changed by chulili 20110707现不再有当前编辑图层选项
            //m_enumQueryMode = enumQueryMode.CurEdit;  //changed by chulili 2011-04-15 默认当前编辑图层
        }
Esempio n. 44
0
        public moveFeatureTool()
        {
            //
            // TODO: �ڴ˴���ӹ��캯���߼�
            //
            base.m_caption = "�ƶ�Ҫ��";
            base.m_category = "CustomCommands";
            base.m_message = "MoveFeature";
            base.m_name = "CustomCommands_identify";
            base.m_toolTip = "�ƶ�Ҫ��";

            m_HookHelper= new HookHelperClass();
        }
Esempio n. 45
0
        public CreateScaleBar()
        {
            //Create an IHookHelper object
            m_HookHelper = new HookHelperClass();

            //Set the tool properties
            //base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream(GetType(), "scalebar.bmp"));
            base.m_caption = "ScaleBar";
            base.m_category = "myCustomCommands(C#)";
            base.m_message = "Add a scale bar map surround";
            base.m_name = "myCustomCommands(C#)_ScaleBar";
            base.m_toolTip = "Add a scale bar";
            base.m_deactivate = true;
        }
		public PanRight()
		{
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream(GetType(), "PanRight.bmp"));
				if(m_bitmap != null)
				{
					m_bitmap.MakeTransparent(m_bitmap.GetPixel(1,1));
					m_hBitmap = m_bitmap.GetHbitmap();
				}
			}
			m_pHookHelper = new HookHelperClass ();
		}
        public CreateNorthArrow()
        {
            //Create an IHookHelper object
            m_HookHelper = new HookHelperClass();

            //Set the tool properties
            base.m_bitmap = GIS.Properties.Resources.NorthArrow16;
            base.m_caption = "���ָ����";
            base.m_category = "MapPrint";
            base.m_message = "ͨ����ͼ�ϻ������ָ����";
            base.m_name = "MapPrint_CreateNorthArrow";
            base.m_toolTip = "���ָ����";
            base.m_deactivate = true;
        }
Esempio n. 48
0
        public CreateNorthArrow()
        {
            //Create an IHookHelper object
            m_HookHelper = new HookHelperClass();

            //Set the tool properties

            base.m_caption = "NorthArrow";
            base.m_category = "myCustomCommands(C#)";
            base.m_message = "Add a north arrow map surround";
            base.m_name = "myCustomCommands(C#)_NorthArrow";
            base.m_toolTip = "Add a north arrow";
            base.m_deactivate = true;
        }
Esempio n. 49
0
        public CreateScaleBar()
        {
            //Create an IHookHelper object
            m_HookHelper = new HookHelperClass();

            //Set the tool properties
            base.m_bitmap = GIS.Properties.Resources.MapReferenceScale16 ;
            base.m_caption = "��ӱ�����";
            base.m_category = "MapPrint";
            base.m_message = "ͨ����ͼ�ϻ�����ӱ�����";
            base.m_name = "MapPrint_CreateScaleBar";
            base.m_toolTip = "��ӱ�����";
            base.m_deactivate = true;
        }
Esempio n. 50
0
        public slovePathTool(StatusBar _pStatusBar)
        {
            //
            // TODO: �ڴ˴���ӹ��캯���߼�
            //

            pStatusBar=_pStatusBar;

            base.m_caption = "����·��";
            base.m_category = "CustomCommands";
            base.m_message = "pathFinder";
            base.m_name = "CustomCommands_sloverPath";
            base.m_toolTip = "����·��";

            m_HookHelper=new HookHelperClass();
            // set up the IPointToEID ...
        }
Esempio n. 51
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (hook == null)
                return;

            try
            {
                m_mapControl = (IMapControl3)hook;
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_mapControl == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;

            // TODO:  Add other initialization code
        }
Esempio n. 52
0
        /// <summary>
        ///创建工具
        /// </summary>
        /// <params name="hook">程序实例</params>
        public override void OnCreate(object hook)
        {
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                m_command.OnCreate(hook);
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;
        }
        public override void OnCreate(object hook)
        {
            if (hook == null)
                return;

            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                    m_hookHelper = null;
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;
        }
Esempio n. 54
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;

              pPageLayoutControl = m_hookHelper.Hook as IPageLayoutControl3;
        }
        /// <summary>
        /// ɾ�����������ص�Ԫ��
        /// </summary>
        public void DeleteAllElements(IHookHelper hookHelper)
        {
            //m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
            IGraphicsContainer g = hookHelper.ActiveView.GraphicsContainer;

            //RemoveElementFromGroupElement(m_Elements);
            try
            {
                //g.DeleteElement(m_Elements as IElement);
                g.DeleteAllElements();
            }
            catch
            { }
            finally
            {
                m_TraceElement = null;
                m_LabelElement = null;
                m_VertexElement = null;
                m_Elements = null;
                //�����ˢ��һ��
                hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
                hookHelper.ActiveView.Refresh();
            }
        }
Esempio n. 56
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (getSetHookHelper == null)
                getSetHookHelper = new HookHelperClass();

            getSetHookHelper.Hook = hook;
        }
Esempio n. 57
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (hook == null)
                return;

            // Test the hook that calls this command and disable if nothing is valid
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }
            if (m_hookHelper == null)
            {
                //Can be scene or globe
                try
                {
                    m_sceneHookHelper = new SceneHookHelperClass();
                    m_sceneHookHelper.Hook = hook;
                    if (m_sceneHookHelper.ActiveViewer == null)
                    {
                        m_sceneHookHelper = null;
                    }
                }
                catch
                {
                    m_sceneHookHelper = null;
                }

                if (m_sceneHookHelper == null)
                {
                    //Can be globe
                    try
                    {
                        m_globeHookHelper = new GlobeHookHelperClass();
                        m_globeHookHelper.Hook = hook;
                        if (m_globeHookHelper.ActiveViewer == null)
                        {
                            m_globeHookHelper = null;
                        }
                    }
                    catch
                    {
                        m_globeHookHelper = null;
                    }
                }
            }

            if (m_globeHookHelper == null && m_sceneHookHelper == null && m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;

            //TODO: Add other initialization code
        }
        public ClearFeatureSelection()
        {
            //Create an IHookHelper object
            m_HookHelper = new HookHelperClass();

            //Set the tool properties
            base.m_caption = "Clear Feature Selection";
            base.m_category = "Sample_Select(C#)";
            base.m_name = "Sample_Select(C#)_Clear Feature Selection";
            base.m_message = "Clear Current Feature Selection";
            base.m_toolTip = "Clear Feature Selection";
            base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream(GetType(), "ClearSelection.bmp"));
        }
        public override void OnCreate(object hook)
        {
            // Test the hook that calls this command and disable if nothing valid
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }
            if (m_hookHelper == null)
            {
                //Can be globe
                try
                {
                    m_globeHookHelper = new GlobeHookHelperClass();
                    m_globeHookHelper.Hook = hook;
                    if (m_globeHookHelper.ActiveViewer == null)
                    {
                        //Nothing valid!
                        m_globeHookHelper = null;
                    }
                }
                catch
                {
                    m_globeHookHelper = null;
                }
            }

            if (m_globeHookHelper == null  && m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;
        }
Esempio n. 60
0
        public override void OnCreate(object Hook)
        {
            base.OnCreate(Hook);

            m_hookHelper = base.m_Hook.Hook as IHookHelper;
        }