示例#1
0
        private bool setCommandDetail(string cmdText, CommandDetail cmdInfo)
        {
            string[] example, illustration;
            switch (cmdText)
            {
            case CommonDefine.openPokemonFunc:
                example      = new string[] { "开启宝可梦功能" };
                illustration = new string[] { "开启宝可梦功能" };
                break;

            case CommonDefine.closePokemonFunc:
                example      = new string[] { "关闭宝可梦功能" };
                illustration = new string[] { "关闭宝可梦功能" };
                break;

            case CommonDefine.queryPokemonInfo:
                example      = new string[] { "查 全国图鉴编号(1-809)/宝可梦名字(支持中、日、英)", "查询宝可梦 123", "查 妙蛙种子" };
                illustration = new string[] { "查询宝可梦的详细信息" };
                break;

            case CommonDefine.queryPokemonSpeciesStrength:
                example      = new string[] { "种族值 全国图鉴编号(1-809)/宝可梦名字(支持中文)", "种族值 妙蛙种子" };
                illustration = new string[] { "查询宝可梦的种族值" };
                break;

            case CommonDefine.queryPokemonEvolvePath:
                example      = new string[] { "进化 全国图鉴编号(1-809)/宝可梦名字(支持中文)", "进化 妙蛙种子" };
                illustration = new string[] { "查询宝可梦的进化路径" };
                break;

            default:
                gB_modifyCmd.Visible = false;
                return(false);
            }
            lable_instruct.Text       = cmdText;
            tB_command.Lines          = cmdInfo.Command.Split('|');
            tB_example.Lines          = example;
            tB_illustrate.Lines       = illustration;
            cB_members.Checked        = (cmdInfo.Role & 1) == 1;
            cB_clusterManager.Checked = ((cmdInfo.Role >> 1) & 1) == 1;
            cB_clusterOwner.Checked   = ((cmdInfo.Role >> 2) & 1) == 1;
            cB_softManager.Checked    = ((cmdInfo.Role >> 3) & 1) == 1;
            cB_ChargeQQ.Checked       = ((cmdInfo.Role >> 5) & 1) == 1;

            cB_friend.Checked   = (cmdInfo.DoIM & 1) == 1;
            cB_tempConv.Checked = ((cmdInfo.DoIM >> 1) & 1) == 1;
            cB_cluster.Checked  = ((cmdInfo.DoIM >> 2) & 1) == 1;
            cB_discuss.Checked  = ((cmdInfo.DoIM >> 3) & 1) == 1;

            return(true);
        }
示例#2
0
        private void button_cmdDefault_Click(object sender, EventArgs e)
        {
            ListViewItem item    = lV_cmdList.SelectedItems[0];
            string       cmdText = item.SubItems[0].Text;

            CommandDetail cmdInfo = getDefaultPluginCommand(cmdText);

            if (cmdInfo == null)
            {
                gB_modifyCmd.Visible = false;
            }
            else
            {
                setCommandDetail(cmdText, cmdInfo);
            }
        }
示例#3
0
        private void lV_cmdList_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListViewItem item    = lV_cmdList.SelectedItems[0];
            string       cmdText = item.SubItems[0].Text;

            CommandDetail cmdInfo = GetPluginConfigCommand(cmdText);

            if (cmdInfo == null)
            {
                gB_modifyCmd.Visible = false;
            }
            else if (setCommandDetail(cmdText, cmdInfo))
            {
                gB_modifyCmd.Visible = true;
            }
        }
示例#4
0
        /// <summary>
        /// 根据cmd类型,获取插件命令详情
        /// </summary>
        /// <param name="cmdType"></param>
        /// <returns></returns>
        private CommandDetail getDefaultPluginCommand(string cmdText)
        {
            CommandDetail retCmd = new CommandDetail();

            switch (cmdText)
            {
            case CommonDefine.openPokemonFunc:
                retCmd.Command = "开启宝可梦功能";
                retCmd.Role    = 14;
                retCmd.DoIM    = 15;
                break;

            case CommonDefine.closePokemonFunc:
                retCmd.Command = "关闭宝可梦功能";
                retCmd.Role    = 14;
                retCmd.DoIM    = 15;
                break;

            case CommonDefine.queryPokemonInfo:
                retCmd.Command = "查询宝可梦信息";
                retCmd.Role    = 15;
                retCmd.DoIM    = 15;
                break;

            case CommonDefine.queryPokemonSpeciesStrength:
                retCmd.Command = "查询宝可梦种族值";
                retCmd.Role    = 15;
                retCmd.DoIM    = 15;
                break;

            case CommonDefine.queryPokemonEvolvePath:
                retCmd.Command = "查询宝可梦进化路径";
                retCmd.Role    = 15;
                retCmd.DoIM    = 15;
                break;

            default:
                return(null);
            }
            return(retCmd);
        }