public static IEnumerable <string> EnumerateHkiFiles() { var folders = Directory.GetDirectories(ProgramModel.MakeHawkempirePath("Games")) .Concat(new[] { ProgramModel.MakeHawkempirePath(string.Empty) }); return(folders.SelectMany(f => Directory.GetFiles(f, "*.hki", SearchOption.TopDirectoryOnly))); }
public void Execute(object parameter) { var paras = ((string)parameter).Split(':'); var hawk = paras[0].Equals("hawk", StringComparison.InvariantCultureIgnoreCase); var path = paras[1]; try { var exePath = hawk ? ProgramModel.MakeHawkempirePath(path) : ProgramModel.MakeExeRelativePath(path); Process.Start(new ProcessStartInfo(exePath) { WorkingDirectory = Path.GetDirectoryName(exePath), UseShellExecute = true, }); } catch (Win32Exception ex) { MessageBox.Show(ex.ToString()); } }