示例#1
0
文件: MainForm.cs 项目: nakijun/adasg
        private void menuItemAdvanced_Click(object sender, EventArgs e)
        {
            ConfirmForm f = new ConfirmForm();

            if (!IsDeployed || f.ShowDialog() == DialogResult.OK)
            {
                this.OpenApplication(4);
            }
        }
示例#2
0
文件: MainForm.cs 项目: nakijun/adasg
        private void menuItemExit_Click(object sender, EventArgs e)
        {
            ConfirmForm f = new ConfirmForm();

            f.Text = "Sure to exit?";

            if (!IsDeployed || f.ShowDialog() == DialogResult.OK)
            {
                CloseAllApplications();
                Close();
            }
        }
示例#3
0
文件: MainForm.cs 项目: nakijun/adasg
        private void SetVoice(bool maleVoice)
        {
            if (maleVoice != _maleVoice)
            {
                ConfirmForm f = new ConfirmForm();
                f.Text = "Sure to change voice?";

                if (!IsDeployed || f.ShowDialog() == DialogResult.OK)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    CloseAllApplications();

                    try
                    {
                        string fullyQualifiedName = Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
                        string strProgramFilesDir = Path.GetDirectoryName(Path.GetDirectoryName(fullyQualifiedName));

                        string sNeoSpeechDBFolderPath;
                        if (maleVoice)
                        {
                            sNeoSpeechDBFolderPath = strProgramFilesDir + "\\DFTTS_Male\\Paul32M\\";
                        }
                        else
                        {
                            sNeoSpeechDBFolderPath = strProgramFilesDir + "\\DFTTS\\Kate32M\\";
                        }

                        string dllFileName;

                        dllFileName = "dfttsmobile.dll";
                        File.Copy(sNeoSpeechDBFolderPath + dllFileName, _appDir + dllFileName, true);

                        dllFileName = "swift.dll";
                        File.Copy(sNeoSpeechDBFolderPath + dllFileName, _appDir + dllFileName, true);

                        dllFileName = "vt_eng.dll";
                        File.Copy(sNeoSpeechDBFolderPath + dllFileName, _appDir + dllFileName, true);

                        _maleVoice = maleVoice;
                        this.Setting.GlobalSetting.SetValue(USING_DFTTS_MALE_VOICE, _maleVoice);
                    }
                    catch (Exception ex)
                    {
                        ReportError(ex);
                    }

                    Cursor.Current = Cursors.Default;
                }
            }

            menuItemMaleVoice.Checked   = _maleVoice;
            menuItemFemailVoice.Checked = !_maleVoice;
        }