1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-12-03 18:46:05 +03:00
ProxySU/ProxySuper.Core/Models/Hosts/Host.cs

56 lines
1.3 KiB
C#
Raw Normal View History

2021-05-26 11:22:18 +03:00
using Microsoft.Win32;
using MvvmCross.Commands;
using Newtonsoft.Json;
2021-05-26 11:22:18 +03:00
using System.ComponentModel;
2021-05-14 14:07:19 +03:00
using System.Threading.Tasks;
2021-05-26 11:22:18 +03:00
using System.Windows;
2021-05-14 14:07:19 +03:00
namespace ProxySuper.Core.Models.Hosts
{
public class Host
{
public Host()
{
Proxy = new LocalProxy();
}
public string Tag { get; set; }
public string Address { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public int Port { get; set; } = 22;
public string PrivateKeyPath { get; set; }
public LocalProxy Proxy { get; set; }
public LoginSecretType SecretType { get; set; }
2021-05-26 11:22:18 +03:00
public IMvxCommand UploadPrivateKeyCommand => new MvxCommand(UploadPrivateKey);
private void UploadPrivateKey()
{
var fileDialog = new OpenFileDialog();
fileDialog.FileOk += OnFileOk;
fileDialog.ShowDialog();
}
private void OnFileOk(object sender, CancelEventArgs e)
{
var file = sender as OpenFileDialog;
PrivateKeyPath = file.FileName;
Task.Delay(300).ContinueWith((t) =>
{
MessageBox.Show("上传成功", "提示");
});
}
2021-05-14 14:07:19 +03:00
}
}