public void Run(DataGrid dataGrid) { if (Bat.IsBat(dataGrid, out Bat bat)) { Process.Start(bat.Path); } }
public List <Bat> ParseBats(List <string> batFiles, DataGrid dataGrid) { var bats = new List <Bat>(); var skippedFiles = new List <string>(); foreach (var batFile in batFiles) { var bat = new Bat(batFile, dataGrid); if (!string.IsNullOrEmpty(bat.Shortcut) && !string.IsNullOrEmpty(bat.Command) && bat.Type != ShortcutType.Unknown) { bats.Add(bat); } else { skippedFiles.Add(batFile); } } if (skippedFiles.Any()) { Console.WriteLine("*** Skipped files: ***"); skippedFiles.ForEach(t => Console.WriteLine(t)); } return(bats); }
public void Edit(DataGrid dataGrid) { if (Bat.IsBat(dataGrid, out Bat bat)) { Process.Start("notepad.exe", bat.Path); } }
public void OpenDestinationLocation(DataGrid dataGrid) { if (Bat.IsBat(dataGrid, out Bat bat)) { var location = Path.GetDirectoryName(bat?.Destination); if (location != "") { Process.Start(location); } } }
public void Delete(DataGrid dataGrid) { if (Bat.IsBat(dataGrid, out Bat bat)) { File.Delete(bat.Path); bats.Remove(bat); dataGrid.Items.Refresh(); } PopulateDataGrid(dataGrid, _outputFolder); }