예제 #1
0
        /// <summary>
        /// 创建工具
        /// </summary>
        /// <param name="hook">程序实例</param>
        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;
            }

            //确保用户控件初始化
            if (null == m_layerListCtrl)
            {
                m_layerListCtrl = new LayersListControl();
                m_layerListCtrl.CreateControl();
            }
            //设置控件的Map属性
            m_layerListCtrl.Map = m_hookHelper.FocusMap;
        }
예제 #2
0
        /// <summary>
        /// ��������
        /// </summary>
        /// <params name="hook">����ʵ��</params>
        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;

            //ȷ���û��ؼ���ʼ��
            if (null == m_layerListCtrl)
            {
                m_layerListCtrl = new LayersListControl();
                m_layerListCtrl.CreateControl();
            }
            //���ÿؼ���Map����
            m_layerListCtrl.Map = m_hookHelper.FocusMap;
        }