public bool RunUtility(IGameFile gameFile) { SpecificFilesForm form = new SpecificFilesForm(); form.AutoCheckSupportedExtensions(false); form.ShowPkContentsCheckBox(true); form.Initialize(m_config.GameFileDirectory, new IGameFile[] { gameFile }, SourcePort.GetSupportedExtensions(m_utility), new string[] { }, m_config.TempDirectory); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog(m_parent) == DialogResult.OK) { var files = form.GetPathedSpecificFiles(); GameFilePlayAdapter adapter = new GameFilePlayAdapter(); StringBuilder sb = new StringBuilder(); adapter.HandleGameFile(gameFile, sb, m_config.GameFileDirectory, m_config.TempDirectory, m_utility, files); //this checks File.Exists and might not be same file try { if (!string.IsNullOrEmpty(m_utility.ExtraParameters)) { sb.Append(" " + m_utility.ExtraParameters); } Process.Start(m_utility.GetFullExecutablePath(), sb.ToString().Trim()); } catch { return(false); } } return(true); }
private void lnkSpecific_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { SpecificFilesForm form = new SpecificFilesForm { StartPosition = FormStartPosition.CenterParent }; List <IGameFileDataSource> gameFiles = new List <IGameFileDataSource> { this.GameFile }; gameFiles.AddRange(this.GetAdditionalFiles()); form.Initialize(this.GameFileDirectory, gameFiles, this.GetSupportedExtensions(), this.SpecificFiles); if (form.ShowDialog(this) == DialogResult.OK) { this.SpecificFiles = form.SpecificFiles; } }
private void lnkSpecific_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { SpecificFilesForm form = new SpecificFilesForm(); form.StartPosition = FormStartPosition.CenterParent; List <IGameFile> gameFiles = new List <IGameFile>(); gameFiles.AddRange(GetAdditionalFiles()); form.Initialize(m_appConfig.GameFileDirectory, gameFiles, SourcePort.GetSupportedExtensions(SelectedSourcePort), SpecificFiles); if (form.ShowDialog(this) == DialogResult.OK) { SpecificFiles = form.GetSpecificFiles(); } }