1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-23 21:56:08 +03:00
ProxySU/ProxySuper.Core/Models/Hosts/Host.cs
2021-05-26 16:22:18 +08:00

59 lines
1.3 KiB
C#

using Microsoft.Win32;
using MvvmCross.Commands;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
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("上传成功", "提示");
});
}
}
}