Пример #1
0
        //============================================================
        // <T>选中导出按键事件。</T>
        //============================================================
        private void tsbExportSelected_Click(object sender, System.EventArgs e)
        {
            // 获得选中页和对象
            TabPage page     = tbcPages.SelectedTab;
            string  typeName = page.Tag.ToString();
            object  control  = null;

            if (page.Controls.Count > 0)
            {
                control = page.Controls[0];
            }
            // 导出选中数据
            DialogResult resultCd;

            switch (typeName)
            {
            case "texture":
                resultCd = MessageBox.Show("是否要导出选中纹理?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsTextureDesign texture = control as QDsTextureDesign;
                    texture.ExportSelected();
                    RMoCore.TaskConsole.Show();
                }
                break;

            case "material":
                MessageBox.Show("禁止导出选中材质。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                break;

            case "model":
                resultCd = MessageBox.Show("是否要导出选中模型?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsModelDesign model = control as QDsModelDesign;
                    model.ExportSelected();
                    RMoCore.TaskConsole.Show();
                }
                break;

            case "template":
                resultCd = MessageBox.Show("是否要导出选中模板?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsTemplateDesign template = control as QDsTemplateDesign;
                    template.ExportSelected();
                    RMoCore.TaskConsole.Show();
                }
                break;

            case "scene":
                resultCd = MessageBox.Show("是否要导出选中场景?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsSceneDesign scene = control as QDsSceneDesign;
                    scene.ExportSelected();
                    RMoCore.TaskConsole.Show();
                }
                break;

            default:
                throw new FFatalException("Unknown type. (type_name={0})", typeName);
            }
        }
Пример #2
0
        //============================================================
        // <T>选中保存按键事件。</T>
        //============================================================
        private void tsbSaveSelected_Click(object sender, System.EventArgs e)
        {
            // 获得选中页和对象
            TabPage page     = tbcPages.SelectedTab;
            string  typeName = page.Tag.ToString();
            object  control  = null;

            if (page.Controls.Count > 0)
            {
                control = page.Controls[0];
            }
            // 导出全部数据
            DialogResult resultCd;

            switch (typeName)
            {
            case "texture":
                resultCd = MessageBox.Show("是否要保存选中纹理?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsTextureDesign texture = control as QDsTextureDesign;
                    texture.SaveSelect();
                    MessageBox.Show("保存选中纹理成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                break;

            case "material":
                resultCd = MessageBox.Show("是否要保存选中材质?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsMaterialDesign material = control as QDsMaterialDesign;
                    material.SaveSelect();
                    MessageBox.Show("保存选中材质成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                break;

            case "model":
                resultCd = MessageBox.Show("是否要保存选中模型?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsModelDesign model = control as QDsModelDesign;
                    model.SaveSelect();
                    MessageBox.Show("保存选中模型成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                break;

            case "template":
                resultCd = MessageBox.Show("是否要保存选中模板?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsTemplateDesign template = control as QDsTemplateDesign;
                    template.SaveSelect();
                    MessageBox.Show("保存选中模板成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                break;

            case "scene":
                resultCd = MessageBox.Show("是否要保存选中场景?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resultCd == DialogResult.OK)
                {
                    QDsSceneDesign scene = control as QDsSceneDesign;
                    scene.SaveSelect();
                    MessageBox.Show("保存选中场景成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                break;

            default:
                throw new FFatalException("Unknown type. (type_name={0})", typeName);
            }
        }