Exemple #1
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_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;
            }

            // TODO:  Add other initialization code
            //确保用户控件初始化
            if (null == m_layerListCtrl)
            {
                m_layerListCtrl = new LayersListControl();
                m_layerListCtrl.CreateControl();
            }
            //设置控件的Map属性
            m_layerListCtrl.Map = m_hookHelper.FocusMap;
        }
        /// <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_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;

            // TODO:  Add other initialization code
            //ȷ���û��ؼ���ʼ��
            if (null == m_layerListCtrl)
            {
                m_layerListCtrl = new LayersListControl();
                m_layerListCtrl.CreateControl();
            }
            //���ÿؼ���Map����
            m_layerListCtrl.Map = m_hookHelper.FocusMap;
        }