mirror of
https://github.com/4sval/FModel.git
synced 2026-03-22 01:34:37 -05:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Linq;
|
|
using FModel.Framework;
|
|
using FModel.Services;
|
|
|
|
namespace FModel.ViewModels.Commands
|
|
{
|
|
public class SavePropertyCommand : ViewModelCommand<ApplicationViewModel>
|
|
{
|
|
private ThreadWorkerViewModel _threadWorkerView => ApplicationService.ThreadWorkerView;
|
|
|
|
public SavePropertyCommand(ApplicationViewModel contextViewModel) : base(contextViewModel)
|
|
{
|
|
}
|
|
|
|
public override async void Execute(ApplicationViewModel contextViewModel, object parameter)
|
|
{
|
|
if (parameter == null) return;
|
|
|
|
var assetItems = ((IList) parameter).Cast<AssetItem>().ToArray();
|
|
if (!assetItems.Any()) return;
|
|
|
|
await _threadWorkerView.Begin(_ =>
|
|
{
|
|
foreach (var asset in assetItems)
|
|
{
|
|
contextViewModel.CUE4Parse.Extract(asset.FullPath);
|
|
contextViewModel.CUE4Parse.TabControl.SelectedTab.SaveProperty(false);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
} |