2015-01-27 22:56:52 +00:00
|
|
|
|
using System;
|
2015-05-26 13:55:52 +00:00
|
|
|
|
using System.IO;
|
2015-01-27 22:56:52 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace xServer.Forms
|
|
|
|
|
{
|
|
|
|
|
public partial class FrmUpdate : Form
|
|
|
|
|
{
|
|
|
|
|
private readonly int _selectedClients;
|
|
|
|
|
|
|
|
|
|
public FrmUpdate(int selected)
|
|
|
|
|
{
|
|
|
|
|
_selectedClients = selected;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FrmUpdate_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Text = string.Format("xRAT 2.0 - Update [Selected: {0}]", _selectedClients);
|
2015-05-26 13:55:52 +00:00
|
|
|
|
if (Core.Misc.Update.UseDownload)
|
|
|
|
|
radioURL.Checked = true;
|
|
|
|
|
txtPath.Text = File.Exists(Core.Misc.Update.UploadPath) ? Core.Misc.Update.UploadPath : string.Empty;
|
2015-01-27 22:56:52 +00:00
|
|
|
|
txtURL.Text = Core.Misc.Update.DownloadURL;
|
2015-05-26 13:55:52 +00:00
|
|
|
|
btnUpdate.Text = "Update Client" + ((_selectedClients > 1) ? "s" : string.Empty);
|
2015-01-27 22:56:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnUpdate_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-05-26 13:55:52 +00:00
|
|
|
|
Core.Misc.Update.UseDownload = radioURL.Checked;
|
|
|
|
|
Core.Misc.Update.UploadPath = File.Exists(txtPath.Text) ? txtPath.Text : string.Empty;
|
2015-01-27 22:56:52 +00:00
|
|
|
|
Core.Misc.Update.DownloadURL = txtURL.Text;
|
|
|
|
|
|
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2015-05-26 13:55:52 +00:00
|
|
|
|
|
|
|
|
|
private void btnBrowse_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
using (OpenFileDialog ofd = new OpenFileDialog())
|
|
|
|
|
{
|
|
|
|
|
ofd.Multiselect = false;
|
|
|
|
|
ofd.Filter = "Executable (*.exe)|*.exe";
|
|
|
|
|
if (ofd.ShowDialog() == DialogResult.OK)
|
|
|
|
|
{
|
|
|
|
|
txtPath.Text = Path.Combine(ofd.InitialDirectory, ofd.FileName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void radioLocalFile_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
groupLocalFile.Enabled = radioLocalFile.Checked;
|
|
|
|
|
groupURL.Enabled = !radioLocalFile.Checked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void radioURL_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
groupLocalFile.Enabled = !radioURL.Checked;
|
|
|
|
|
groupURL.Enabled = radioURL.Checked;
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-27 22:56:52 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
}
|