mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-22 21:26:09 +03:00
55 lines
1.2 KiB
C#
55 lines
1.2 KiB
C#
using Microsoft.Win32;
|
|
using MvvmCross.Commands;
|
|
using System.ComponentModel;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
|
|
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; }
|
|
|
|
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("上传成功", "提示");
|
|
});
|
|
}
|
|
}
|
|
}
|