using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Nucs.JsonSettings;
using PSCHelpdesk.Models;
using PSCHelpdesk.Shared.ViewModels;

namespace PSCHelpdesk.ViewModels;

public partial class SettingsViewModel : ViewModelBase
{
    private string _globalConfigFilePath;
    private string _sshClientPath;
    private string _sshClientPathArgs;
    private string _scpClientPath;
    private string _scpClientPathArgs;
    private string _privateSSHKeyPath;
    
    public string GlobalConfigFilePath
    {
        get => _globalConfigFilePath;
        set => SetAndRaisePropertyChanged(ref _globalConfigFilePath, value);
    }
    
    public string SshClientPath
    {
        get => _sshClientPath;
        set => SetAndRaisePropertyChanged(ref _sshClientPath, value);
    }
    
    public string ScpClientPath
    {
        get => _scpClientPath;
        set => SetAndRaisePropertyChanged(ref _scpClientPath, value);
    }
    public string SshClientPathArgs
    {
        get => _sshClientPathArgs;
        set => SetAndRaisePropertyChanged(ref _sshClientPathArgs, value);
    }
    
    public string ScpClientPathArgs
    {
        get => _scpClientPathArgs;
        set => SetAndRaisePropertyChanged(ref _scpClientPathArgs, value);
    }
    
    public string PrivateSSHKeyPath
    {
        get => _privateSSHKeyPath;
        set => SetAndRaisePropertyChanged(ref _privateSSHKeyPath, value);
    }
    
    public SettingsViewModel()
    {
        LocalSetting settings = new LocalSetting();
        settings.Load();
        this.GlobalConfigFilePath = settings.GlobalConfigFilePath;
        this.PrivateSSHKeyPath = settings.PrivateSSHKeyPath;
        this.ScpClientPath = settings.SCPClientExecutable;
        this.SshClientPath = settings.SSHClientExecutable;
    }
    
    
}