added "Set file type" command.

This commit is contained in:
morkt
2015-08-23 07:35:05 +04:00
parent 31842bdea5
commit ab19d0b0e3
8 changed files with 90 additions and 6 deletions

View File

@@ -526,6 +526,21 @@ namespace GARbro.GUI
lv_SetSortMode (sort_by, ListSortDirection.Ascending);
}
/// <summary>
/// Handle "Set file type" commands.
/// </summary>
private void SetFileTypeExec (object sender, ExecutedRoutedEventArgs e)
{
var selected = CurrentDirectory.SelectedItems.Cast<EntryViewModel>().Where (x => !x.IsDirectory);
if (!selected.Any())
return;
string type = e.Parameter as string;
foreach (var entry in selected)
{
entry.Type = type;
}
}
/// <summary>
/// Event handler for keys pressed in the directory view pane
/// </summary>
@@ -1314,5 +1329,6 @@ namespace GARbro.GUI
public static readonly RoutedCommand HideToolBar = new RoutedCommand();
public static readonly RoutedCommand AddSelection = new RoutedCommand();
public static readonly RoutedCommand SelectAll = new RoutedCommand();
public static readonly RoutedCommand SetFileType = new RoutedCommand();
}
}