44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.IO;
|
|
using System.Threading.Tasks;
|
|
using Flawless.Abstraction;
|
|
using Flawless.Client.Models;
|
|
using Flawless.Core.Modal;
|
|
using ReactiveUI.SourceGenerators;
|
|
|
|
namespace Flawless.Client.ViewModels.ModalBox;
|
|
|
|
public partial class MergeDialogViewModel : ViewModelBase
|
|
{
|
|
public ObservableCollection<WorkspaceFile> MergeFiles { get; }
|
|
|
|
public RepositoryModel Repository { get; }
|
|
|
|
public string SrcFolder { get; }
|
|
|
|
public string DstFolder { get; }
|
|
|
|
public string TmpFolder { get; }
|
|
|
|
|
|
public MergeDialogViewModel(RepositoryModel repository, IEnumerable<WorkspaceFile> files,
|
|
string srcFolder, string dstFolder)
|
|
{
|
|
Repository = repository;
|
|
MergeFiles = new ObservableCollection<WorkspaceFile>(files);
|
|
SrcFolder = srcFolder;
|
|
DstFolder = dstFolder;
|
|
TmpFolder = Directory.CreateTempSubdirectory("Flawless_Merge").Name;
|
|
}
|
|
|
|
[ReactiveCommand]
|
|
private async Task RaiseMergeToolsAsync(string fileWorkPath)
|
|
{
|
|
var srcFile = WorkPath.ToPlatformPath(fileWorkPath, SrcFolder);
|
|
var dstFile = Path.Combine(fileWorkPath, DstFolder);
|
|
var tmpFile = Path.Combine(fileWorkPath, TmpFolder);
|
|
|
|
|
|
}
|
|
} |