コード例 #1
0
        private void mSelectButton_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.SelectedPath        = mPathTextBox.Text;
            dialog.ShowNewFolderButton = true;
            if (dialog.ShowDialog() == DialogResult.OK && ObiForm.CheckProjectDirectory_Safe(dialog.SelectedPath, true))
            {
                mPathTextBox.Text = dialog.SelectedPath;
            }
        }
コード例 #2
0
 private void mOKButton_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(mPathTextBox.Text))
     {
         MessageBox.Show(Localizer.Message("ExportDirectoryPathEmpty"), Localizer.Message("Caption_Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
         mCanClose = false;
         return;
     }
     if (!m_IsMegaVoiceConnect)
     {
         mCanClose = ObiForm.CheckProjectDirectory_Safe(DirectoryPath, true);
     }
     else
     {
         if (!string.IsNullOrEmpty(mPathTextBox.Text) && !string.IsNullOrEmpty(m_MegaVoiceExportFileName))
         {
             string MegaVoiceExportFinalPath = mPathTextBox.Text + "\\" + m_MegaVoiceExportFileName;
             if (Directory.Exists(MegaVoiceExportFinalPath))
             {
                 DialogResult tempResult = MessageBox.Show(Localizer.Message("ExportFolderExistsMegavoice"), Localizer.Message("Caption_Warning"),
                                                           MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                 if (tempResult == DialogResult.No)
                 {
                     mCanClose = false;
                     return;
                 }
             }
             mCanClose = ObiForm.CheckProjectDirectory_Safe(m_TemprorayPathOfMegavoiceExport, true, false);
         }
     }
     if (mCanClose && m_chkBoxCreateMediaOverlays.Enabled)
     {
         mSettings.Export_EpubCreateMediaOverlays = m_chkBoxCreateMediaOverlays.Checked;
     }
     if (m_chkBoxAddCuePointsInAudio.Checked)
     {
         DialogResult result = MessageBox.Show(string.Format(Localizer.Message("ExportInsertCuePointOrCopy"), "\n"), Localizer.Message("Caption_Information"), MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             m_IsInsertCuePoints = true;
         }
     }
 }
コード例 #3
0
        private void mSelectButton_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.SelectedPath        = mPathTextBox.Text;
            dialog.ShowNewFolderButton = true;
            if (dialog.ShowDialog() == DialogResult.OK && (m_IsMegaVoiceConnect || ObiForm.CheckProjectDirectory_Safe(dialog.SelectedPath, true)))
            {
                if (m_IsMegaVoiceConnect)
                {
                    var  drives           = DriveInfo.GetDrives();
                    bool isRemovableDrive = false;
                    //List<string> temp = new List<string>();
                    foreach (var drive in drives)
                    {
                        if (drive.DriveType == DriveType.Removable)
                        {
                            Console.WriteLine(drive.Name);
                            //temp.Add(drive.Name);
                            if (dialog.SelectedPath.Contains(drive.Name))
                            {
                                if (dialog.SelectedPath == drive.Name)
                                {
                                    isRemovableDrive = true;
                                }
                            }
                        }
                    }
                    if (!isRemovableDrive)
                    {
                        DialogResult tempResult = MessageBox.Show(Localizer.Message("USBDriveCheck"), Localizer.Message("Caption_Information"), MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                        if (tempResult == DialogResult.No)
                        {
                            return;
                        }
                    }
                }
                mPathTextBox.Text = dialog.SelectedPath;
            }
        }
コード例 #4
0
 private void mOKButton_Click(object sender, EventArgs e)
 {
     mCanClose = ObiForm.CheckProjectDirectory_Safe(DirectoryPath, true);
 }