Example #1
0
        /// <summary>
        /// 初始化子系统界面的选中状态   chenyafei  add 20110215  页面跳转
        /// </summary>
        /// <param name="pSysName">子系统name</param>
        /// <param name="pSysCaption">子系统caption</param>
        public static void InitialForm(string pSysName, string pSysCaption)
        {
            if (Plugin.ModuleCommon.DicTabs == null || Plugin.ModuleCommon.AppFrm == null)
            {
                return;
            }
            //初始化当前应用成素的名称和标题
            Plugin.ModuleCommon.AppFrm.CurrentSysName = pSysName;
            Plugin.ModuleCommon.AppFrm.Caption        = pSysCaption;

            //显示选定的子系统界面
            bool bEnable  = false;
            bool bVisible = false;

            if (Plugin.ModuleCommon.DicControls != null)
            {
                foreach (KeyValuePair <string, Plugin.Interface.IControlRef> keyValue in Plugin.ModuleCommon.DicControls)
                {
                    bEnable  = keyValue.Value.Enabled;
                    bVisible = keyValue.Value.Visible;

                    Plugin.Interface.ICommandRef pCmd = keyValue.Value as Plugin.Interface.ICommandRef;
                    if (pCmd != null)
                    {
                        if (keyValue.Key == pSysName)
                        {
                            pCmd.OnClick();
                        }
                    }
                }
            }
            //默认显示子系统界面的第一项
            int i = 0;

            foreach (KeyValuePair <DevComponents.DotNetBar.RibbonTabItem, string> keyValue in Plugin.ModuleCommon.DicTabs)
            {
                if (keyValue.Value == pSysName)
                {
                    i = i + 1;
                    keyValue.Key.Visible = true;
                    keyValue.Key.Enabled = true;
                    if (i == 1)
                    {
                        //默认选中第一项
                        keyValue.Key.Checked = true;
                    }
                }
                else
                {
                    keyValue.Key.Visible = false;
                    keyValue.Key.Enabled = false;
                }
            }
        }
Example #2
0
        private void barMap_ItemClick(object sender, EventArgs e)
        {
            DevComponents.DotNetBar.ButtonItem aButtonItem = sender as DevComponents.DotNetBar.ButtonItem;
            if (aButtonItem == null)
            {
                return;
            }

            if (v_dicCommands.ContainsKey(aButtonItem.Name))
            {
                Plugin.Interface.ICommandRef pCommandRef = v_dicCommands[aButtonItem.Name] as Plugin.Interface.ICommandRef;
                pCommandRef.OnClick();
            }

            if (v_dicTools.ContainsKey(aButtonItem.Name))
            {
                Plugin.Interface.IToolRef pToolRef = v_dicTools[aButtonItem.Name] as Plugin.Interface.IToolRef;
                pToolRef.OnClick();
            }
        }