private void workDirBrowse_Click(object sender, EventArgs e) { try { if (Directory.Exists(workDirPath.Text)) { workDirBrowser.SelectedPath = workDirPath.Text; } else if (Directory.Exists(Path.GetDirectoryName(exePath.Text))) { workDirBrowser.SelectedPath = Path.GetDirectoryName(exePath.Text); } else if (m_Core.Config.LastCapturePath.Length > 0) { exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; } } catch (ArgumentException) { // invalid path or similar } if (m_Core.Renderer.Remote == null) { var res = workDirBrowser.ShowDialog(); if (res == DialogResult.Yes || res == DialogResult.OK) { workDirPath.Text = workDirBrowser.SelectedPath; workDirHint = false; workDirPath.ForeColor = SystemColors.WindowText; } } else { VirtualOpenFileDialog remoteBrowser = new VirtualOpenFileDialog(m_Core.Renderer); remoteBrowser.Opened += new EventHandler <FileOpenedEventArgs>(this.virtualWorkDirBrowser_Opened); remoteBrowser.DirectoryBrowse = true; remoteBrowser.ShowDialog(this); } }
private void exeBrowse_Click(object sender, EventArgs e) { try { if (exePath.Text.Length > 0 && Directory.Exists(Path.GetDirectoryName(exePath.Text))) { exeBrowser.InitialDirectory = Path.GetDirectoryName(exePath.Text); } else if (m_Core.Config.LastCapturePath.Length > 0) { if (m_Core.Config.LastCaptureExe.Length > 0) { exeBrowser.FileName = m_Core.Config.LastCaptureExe; exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; } else { exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; } } } catch (ArgumentException) { // invalid path or similar } if (m_Core.Renderer.Remote == null) { exeBrowser.ShowDialog(); } else { VirtualOpenFileDialog remoteBrowser = new VirtualOpenFileDialog(m_Core.Renderer); remoteBrowser.Opened += new EventHandler <FileOpenedEventArgs>(this.virtualExeBrowser_Opened); remoteBrowser.ShowDialog(this); } }
private void exeBrowse_Click(object sender, EventArgs e) { try { if (exePath.Text.Length > 0 && Directory.Exists(Path.GetDirectoryName(exePath.Text))) { exeBrowser.InitialDirectory = Path.GetDirectoryName(exePath.Text); } else if (m_Core.Config.LastCapturePath.Length > 0) { if (m_Core.Config.LastCaptureExe.Length > 0) { exeBrowser.FileName = m_Core.Config.LastCaptureExe; exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; } else { exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; } } } catch (ArgumentException) { // invalid path or similar } if (m_Core.Renderer.Remote == null) { exeBrowser.ShowDialog(); } else { VirtualOpenFileDialog remoteBrowser = new VirtualOpenFileDialog(m_Core.Renderer); remoteBrowser.Opened += new EventHandler<FileOpenedEventArgs>(this.virtualExeBrowser_Opened); remoteBrowser.ShowDialog(this); } }
private void workDirBrowse_Click(object sender, EventArgs e) { try { if (Directory.Exists(workDirPath.Text)) workDirBrowser.SelectedPath = workDirPath.Text; else if (Directory.Exists(Path.GetDirectoryName(exePath.Text))) workDirBrowser.SelectedPath = Path.GetDirectoryName(exePath.Text); else if (m_Core.Config.LastCapturePath.Length > 0) exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; } catch (ArgumentException) { // invalid path or similar } if (m_Core.Renderer.Remote == null) { var res = workDirBrowser.ShowDialog(); if (res == DialogResult.Yes || res == DialogResult.OK) { workDirPath.Text = workDirBrowser.SelectedPath; workDirHint = false; workDirPath.ForeColor = SystemColors.WindowText; } } else { VirtualOpenFileDialog remoteBrowser = new VirtualOpenFileDialog(m_Core.Renderer); remoteBrowser.Opened += new EventHandler<FileOpenedEventArgs>(this.virtualWorkDirBrowser_Opened); remoteBrowser.DirectoryBrowse = true; remoteBrowser.ShowDialog(this); } }