@@ -32,15 +32,6 @@ namespace Shadowsocks.Controller | |||||
public string NewReleaseVersion { get; private set; } | public string NewReleaseVersion { get; private set; } | ||||
public string NewReleaseZipFilename { get; private set; } | public string NewReleaseZipFilename { get; private set; } | ||||
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) | |||||
{ | |||||
CheckUpdateTimer timer = (CheckUpdateTimer)sender; | |||||
Configuration config = timer.config; | |||||
timer.Elapsed -= Timer_Elapsed; | |||||
timer.Enabled = false; | |||||
timer.Dispose(); | |||||
CheckUpdate(config); | |||||
} | |||||
public event EventHandler CheckUpdateCompleted; | public event EventHandler CheckUpdateCompleted; | ||||
public static readonly string Version = Assembly.GetEntryAssembly().GetName().Version.ToString(); | public static readonly string Version = Assembly.GetEntryAssembly().GetName().Version.ToString(); | ||||
@@ -25,7 +25,7 @@ namespace Shadowsocks.Model | |||||
{ | { | ||||
get | get | ||||
{ | { | ||||
if (_NLOG_CONFIG_FILE_NAME.IsNullOrEmpty()) | |||||
if (string.IsNullOrEmpty(_NLOG_CONFIG_FILE_NAME)) | |||||
{ | { | ||||
_NLOG_CONFIG_FILE_NAME = Path.Combine(Environment.CurrentDirectory, "NLog.config"); | _NLOG_CONFIG_FILE_NAME = Path.Combine(Environment.CurrentDirectory, "NLog.config"); | ||||
} | } | ||||
@@ -460,7 +460,7 @@ namespace Shadowsocks.View | |||||
} | } | ||||
} | } | ||||
void notifyIcon1_BalloonTipClicked(object sender, EventArgs e) | |||||
private void CheckUpdateForFirstRun() | |||||
{ | { | ||||
Configuration config = controller.GetCurrentConfiguration(); | Configuration config = controller.GetCurrentConfiguration(); | ||||
if (config.firstRun) | if (config.firstRun) | ||||
@@ -604,80 +604,6 @@ namespace Shadowsocks.View | |||||
disableItem.Checked = !controller.GetCurrentConfiguration().enabled; | disableItem.Checked = !controller.GetCurrentConfiguration().enabled; | ||||
} | } | ||||
private void CheckUpdateForFirstRun() | |||||
{ | |||||
Configuration config = controller.GetConfigurationCopy(); | |||||
if (config.isDefault) return; | |||||
_isStartupChecking = true; | |||||
updateChecker.CheckUpdate(config, 3000); | |||||
} | |||||
#endregion | |||||
#region Main menu | |||||
void controller_ShareOverLANStatusChanged(object sender, EventArgs e) | |||||
{ | |||||
ShareOverLANItem.Checked = controller.GetConfigurationCopy().shareOverLan; | |||||
} | |||||
private void proxyItem_Click(object sender, EventArgs e) | |||||
{ | |||||
ShowProxyForm(); | |||||
} | |||||
private void OnlineConfig_Click(object sender, EventArgs e) | |||||
{ | |||||
ShowOnlineConfigForm(); | |||||
} | |||||
private void hotKeyItem_Click(object sender, EventArgs e) | |||||
{ | |||||
ShowHotKeySettingsForm(); | |||||
} | |||||
private void ShareOverLANItem_Click(object sender, EventArgs e) | |||||
{ | |||||
ShareOverLANItem.Checked = !ShareOverLANItem.Checked; | |||||
controller.ToggleShareOverLAN(ShareOverLANItem.Checked); | |||||
} | |||||
private void AutoStartupItem_Click(object sender, EventArgs e) | |||||
{ | |||||
AutoStartupItem.Checked = !AutoStartupItem.Checked; | |||||
if (!AutoStartup.Set(AutoStartupItem.Checked)) | |||||
{ | |||||
MessageBox.Show(I18N.GetString("Failed to update registry")); | |||||
} | |||||
LoadCurrentConfiguration(); | |||||
} | |||||
private void ProtocolHandlerItem_Click(object sender, EventArgs e) | |||||
{ | |||||
ProtocolHandlerItem.Checked = !ProtocolHandlerItem.Checked; | |||||
if (!ProtocolHandler.Set(ProtocolHandlerItem.Checked)) | |||||
{ | |||||
MessageBox.Show(I18N.GetString("Failed to update registry")); | |||||
} | |||||
LoadCurrentConfiguration(); | |||||
} | |||||
private void Quit_Click(object sender, EventArgs e) | |||||
{ | |||||
controller.Stop(); | |||||
_notifyIcon.Visible = false; | |||||
Application.Exit(); | |||||
} | |||||
#endregion | |||||
#region System proxy | |||||
private void controller_EnableStatusChanged(object sender, EventArgs e) | |||||
{ | |||||
disableItem.Checked = !controller.GetConfigurationCopy().enabled; | |||||
} | |||||
private void EnableItem_Click(object sender, EventArgs e) | private void EnableItem_Click(object sender, EventArgs e) | ||||
{ | { | ||||
controller.ToggleEnable(false); | controller.ToggleEnable(false); | ||||
@@ -757,8 +683,9 @@ namespace Shadowsocks.View | |||||
Configuration configuration = controller.GetCurrentConfiguration(); | Configuration configuration = controller.GetCurrentConfiguration(); | ||||
foreach (var server in configuration.configs) | foreach (var server in configuration.configs) | ||||
{ | { | ||||
if (Configuration.ChecksServer(server)) | |||||
try | |||||
{ | { | ||||
Configuration.CheckServer(server); | |||||
var name = server.ToString(); | var name = server.ToString(); | ||||
if (!items.OfType<ToolStripMenuItem>().Any(ts => ts.Text == name)) | if (!items.OfType<ToolStripMenuItem>().Any(ts => ts.Text == name)) | ||||
{ | { | ||||
@@ -769,6 +696,9 @@ namespace Shadowsocks.View | |||||
serverCount++; | serverCount++; | ||||
} | } | ||||
} | } | ||||
catch | |||||
{ | |||||
} | |||||
} | } | ||||
foreach (var item in items) | foreach (var item in items) | ||||
@@ -807,7 +737,7 @@ namespace Shadowsocks.View | |||||
ShowConfigForm(); | ShowConfigForm(); | ||||
} | } | ||||
void openURLFromQRCode(object sender, FormClosedEventArgs e) | |||||
void openURLFromQRCode() | |||||
{ | { | ||||
Utils.OpenInBrowser(_urlToOpen); | Utils.OpenInBrowser(_urlToOpen); | ||||
} | } | ||||
@@ -1,218 +0,0 @@ | |||||
namespace Shadowsocks.View | |||||
{ | |||||
partial class OnlineConfigForm | |||||
{ | |||||
/// <summary> | |||||
/// Required designer variable. | |||||
/// </summary> | |||||
private System.ComponentModel.IContainer components = null; | |||||
/// <summary> | |||||
/// Clean up any resources being used. | |||||
/// </summary> | |||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||||
protected override void Dispose(bool disposing) | |||||
{ | |||||
if (disposing && (components != null)) | |||||
{ | |||||
components.Dispose(); | |||||
} | |||||
base.Dispose(disposing); | |||||
} | |||||
#region Windows Form Designer generated code | |||||
/// <summary> | |||||
/// Required method for Designer support - do not modify | |||||
/// the contents of this method with the code editor. | |||||
/// </summary> | |||||
private void InitializeComponent() | |||||
{ | |||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.UrlListBox = new System.Windows.Forms.ListBox(); | |||||
this.label1 = new System.Windows.Forms.Label(); | |||||
this.UrlTextBox = new System.Windows.Forms.TextBox(); | |||||
this.UpdateButton = new System.Windows.Forms.Button(); | |||||
this.AddButton = new System.Windows.Forms.Button(); | |||||
this.DeleteButton = new System.Windows.Forms.Button(); | |||||
this.OkButton = new System.Windows.Forms.Button(); | |||||
this.UpdateAllButton = new System.Windows.Forms.Button(); | |||||
this.CancelButton = new System.Windows.Forms.Button(); | |||||
this.tableLayoutPanel1.SuspendLayout(); | |||||
this.SuspendLayout(); | |||||
// | |||||
// tableLayoutPanel1 | |||||
// | |||||
this.tableLayoutPanel1.ColumnCount = 3; | |||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); | |||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); | |||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); | |||||
this.tableLayoutPanel1.Controls.Add(this.UrlListBox, 0, 0); | |||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1); | |||||
this.tableLayoutPanel1.Controls.Add(this.UrlTextBox, 1, 1); | |||||
this.tableLayoutPanel1.Controls.Add(this.UpdateButton, 0, 2); | |||||
this.tableLayoutPanel1.Controls.Add(this.AddButton, 1, 2); | |||||
this.tableLayoutPanel1.Controls.Add(this.DeleteButton, 2, 2); | |||||
this.tableLayoutPanel1.Controls.Add(this.OkButton, 1, 3); | |||||
this.tableLayoutPanel1.Controls.Add(this.UpdateAllButton, 0, 3); | |||||
this.tableLayoutPanel1.Controls.Add(this.CancelButton, 2, 3); | |||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); | |||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; | |||||
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3); | |||||
this.tableLayoutPanel1.RowCount = 4; | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(482, 453); | |||||
this.tableLayoutPanel1.TabIndex = 0; | |||||
// | |||||
// UrlListBox | |||||
// | |||||
this.tableLayoutPanel1.SetColumnSpan(this.UrlListBox, 3); | |||||
this.UrlListBox.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.UrlListBox.FormattingEnabled = true; | |||||
this.UrlListBox.ItemHeight = 15; | |||||
this.UrlListBox.Location = new System.Drawing.Point(13, 13); | |||||
this.UrlListBox.Margin = new System.Windows.Forms.Padding(10); | |||||
this.UrlListBox.Name = "UrlListBox"; | |||||
this.UrlListBox.Size = new System.Drawing.Size(456, 334); | |||||
this.UrlListBox.TabIndex = 0; | |||||
this.UrlListBox.SelectedIndexChanged += new System.EventHandler(this.UrlListBox_SelectedIndexChanged); | |||||
// | |||||
// label1 | |||||
// | |||||
this.label1.AutoSize = true; | |||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.label1.Location = new System.Drawing.Point(6, 357); | |||||
this.label1.Name = "label1"; | |||||
this.label1.Size = new System.Drawing.Size(152, 31); | |||||
this.label1.TabIndex = 1; | |||||
this.label1.Text = "Online config URL"; | |||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; | |||||
// | |||||
// UrlTextBox | |||||
// | |||||
this.tableLayoutPanel1.SetColumnSpan(this.UrlTextBox, 2); | |||||
this.UrlTextBox.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.UrlTextBox.Location = new System.Drawing.Point(164, 360); | |||||
this.UrlTextBox.Margin = new System.Windows.Forms.Padding(3, 3, 15, 3); | |||||
this.UrlTextBox.Name = "UrlTextBox"; | |||||
this.UrlTextBox.Size = new System.Drawing.Size(300, 25); | |||||
this.UrlTextBox.TabIndex = 2; | |||||
// | |||||
// UpdateButton | |||||
// | |||||
this.UpdateButton.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.UpdateButton.Location = new System.Drawing.Point(23, 391); | |||||
this.UpdateButton.Margin = new System.Windows.Forms.Padding(20, 3, 20, 3); | |||||
this.UpdateButton.MaximumSize = new System.Drawing.Size(0, 25); | |||||
this.UpdateButton.MinimumSize = new System.Drawing.Size(0, 25); | |||||
this.UpdateButton.Name = "UpdateButton"; | |||||
this.UpdateButton.Size = new System.Drawing.Size(118, 25); | |||||
this.UpdateButton.TabIndex = 3; | |||||
this.UpdateButton.Text = "&Update"; | |||||
this.UpdateButton.UseVisualStyleBackColor = true; | |||||
this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click); | |||||
// | |||||
// AddButton | |||||
// | |||||
this.AddButton.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.AddButton.Location = new System.Drawing.Point(181, 391); | |||||
this.AddButton.Margin = new System.Windows.Forms.Padding(20, 3, 20, 3); | |||||
this.AddButton.MaximumSize = new System.Drawing.Size(0, 25); | |||||
this.AddButton.MinimumSize = new System.Drawing.Size(0, 25); | |||||
this.AddButton.Name = "AddButton"; | |||||
this.AddButton.Size = new System.Drawing.Size(118, 25); | |||||
this.AddButton.TabIndex = 4; | |||||
this.AddButton.Text = "&Add"; | |||||
this.AddButton.UseVisualStyleBackColor = true; | |||||
this.AddButton.Click += new System.EventHandler(this.AddButton_Click); | |||||
// | |||||
// DeleteButton | |||||
// | |||||
this.DeleteButton.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.DeleteButton.Location = new System.Drawing.Point(339, 391); | |||||
this.DeleteButton.Margin = new System.Windows.Forms.Padding(20, 3, 20, 3); | |||||
this.DeleteButton.MaximumSize = new System.Drawing.Size(0, 25); | |||||
this.DeleteButton.MinimumSize = new System.Drawing.Size(0, 25); | |||||
this.DeleteButton.Name = "DeleteButton"; | |||||
this.DeleteButton.Size = new System.Drawing.Size(120, 25); | |||||
this.DeleteButton.TabIndex = 5; | |||||
this.DeleteButton.Text = "&Delete"; | |||||
this.DeleteButton.UseVisualStyleBackColor = true; | |||||
this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); | |||||
// | |||||
// OkButton | |||||
// | |||||
this.OkButton.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.OkButton.Location = new System.Drawing.Point(181, 422); | |||||
this.OkButton.Margin = new System.Windows.Forms.Padding(20, 3, 20, 3); | |||||
this.OkButton.MaximumSize = new System.Drawing.Size(0, 25); | |||||
this.OkButton.MinimumSize = new System.Drawing.Size(0, 25); | |||||
this.OkButton.Name = "OkButton"; | |||||
this.OkButton.Size = new System.Drawing.Size(118, 25); | |||||
this.OkButton.TabIndex = 7; | |||||
this.OkButton.Text = "OK"; | |||||
this.OkButton.UseVisualStyleBackColor = true; | |||||
this.OkButton.Click += new System.EventHandler(this.OkButton_Click); | |||||
// | |||||
// UpdateAllButton | |||||
// | |||||
this.UpdateAllButton.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.UpdateAllButton.Location = new System.Drawing.Point(23, 422); | |||||
this.UpdateAllButton.Margin = new System.Windows.Forms.Padding(20, 3, 20, 3); | |||||
this.UpdateAllButton.MaximumSize = new System.Drawing.Size(0, 25); | |||||
this.UpdateAllButton.MinimumSize = new System.Drawing.Size(0, 25); | |||||
this.UpdateAllButton.Name = "UpdateAllButton"; | |||||
this.UpdateAllButton.Size = new System.Drawing.Size(118, 25); | |||||
this.UpdateAllButton.TabIndex = 6; | |||||
this.UpdateAllButton.Text = "U&pdate All"; | |||||
this.UpdateAllButton.UseVisualStyleBackColor = true; | |||||
this.UpdateAllButton.Click += new System.EventHandler(this.UpdateAllButton_Click); | |||||
// | |||||
// CancelButton | |||||
// | |||||
this.CancelButton.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.CancelButton.Location = new System.Drawing.Point(339, 422); | |||||
this.CancelButton.Margin = new System.Windows.Forms.Padding(20, 3, 20, 3); | |||||
this.CancelButton.MaximumSize = new System.Drawing.Size(0, 25); | |||||
this.CancelButton.MinimumSize = new System.Drawing.Size(0, 25); | |||||
this.CancelButton.Name = "CancelButton"; | |||||
this.CancelButton.Size = new System.Drawing.Size(120, 25); | |||||
this.CancelButton.TabIndex = 8; | |||||
this.CancelButton.Text = "Cancel"; | |||||
this.CancelButton.UseVisualStyleBackColor = true; | |||||
this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click); | |||||
// | |||||
// OnlineConfigForm | |||||
// | |||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); | |||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
this.ClientSize = new System.Drawing.Size(482, 453); | |||||
this.Controls.Add(this.tableLayoutPanel1); | |||||
this.MinimizeBox = false; | |||||
this.MinimumSize = new System.Drawing.Size(400, 400); | |||||
this.Name = "OnlineConfigForm"; | |||||
this.Text = "Online config"; | |||||
this.tableLayoutPanel1.ResumeLayout(false); | |||||
this.tableLayoutPanel1.PerformLayout(); | |||||
this.ResumeLayout(false); | |||||
} | |||||
#endregion | |||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; | |||||
private System.Windows.Forms.ListBox UrlListBox; | |||||
private System.Windows.Forms.Label label1; | |||||
private System.Windows.Forms.TextBox UrlTextBox; | |||||
private System.Windows.Forms.Button UpdateButton; | |||||
private System.Windows.Forms.Button AddButton; | |||||
private System.Windows.Forms.Button DeleteButton; | |||||
private System.Windows.Forms.Button OkButton; | |||||
private System.Windows.Forms.Button UpdateAllButton; | |||||
private System.Windows.Forms.Button CancelButton; | |||||
} | |||||
} |
@@ -1,153 +0,0 @@ | |||||
using System; | |||||
using System.Data; | |||||
using System.Linq; | |||||
using System.Windows.Forms; | |||||
using Shadowsocks.Controller; | |||||
using Shadowsocks.Model; | |||||
using Shadowsocks.Properties; | |||||
namespace Shadowsocks.View | |||||
{ | |||||
public partial class OnlineConfigForm : Form | |||||
{ | |||||
private ShadowsocksController controller; | |||||
private Configuration config; | |||||
public OnlineConfigForm(ShadowsocksController controller) | |||||
{ | |||||
this.controller = controller; | |||||
InitializeComponent(); | |||||
LoadConfig(); | |||||
Icon = System.Drawing.Icon.FromHandle(Resources.ssw128.GetHicon()); | |||||
I18N.TranslateForm(this); | |||||
} | |||||
private void LoadConfig() | |||||
{ | |||||
config = controller.GetConfigurationCopy(); | |||||
var idx = UrlListBox.SelectedIndex; | |||||
UrlListBox.Items.Clear(); | |||||
foreach (var item in config.onlineConfigSource) | |||||
{ | |||||
UrlListBox.Items.Add(item); | |||||
} | |||||
if (idx >= UrlListBox.Items.Count) idx = 0; | |||||
if (idx < 0 && UrlListBox.Items.Count > 0) idx = 0; | |||||
if (UrlListBox.Items.Count == 0) return; | |||||
UrlListBox.SelectedIndex = idx; | |||||
SelectItem(); | |||||
} | |||||
private void SelectItem() | |||||
{ | |||||
UrlTextBox.Text = (string)UrlListBox.SelectedItem; | |||||
} | |||||
private bool ValidateUrl() | |||||
{ | |||||
try | |||||
{ | |||||
var scheme = new Uri(UrlTextBox.Text).Scheme; | |||||
if (scheme != "http" && scheme != "https") return false; | |||||
if (UrlListBox.Items.OfType<string>().Contains(UrlTextBox.Text)) return false; | |||||
} | |||||
catch | |||||
{ | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
private void Commit() | |||||
{ | |||||
if (UrlListBox.SelectedIndex < 0) return; | |||||
if ((string)UrlListBox.SelectedItem == UrlTextBox.Text) | |||||
{ | |||||
LoadConfig(); | |||||
return; | |||||
} | |||||
if (ValidateUrl()) | |||||
{ | |||||
UrlListBox.Items[UrlListBox.SelectedIndex] = UrlTextBox.Text; | |||||
} | |||||
controller.SaveOnlineConfigSource(UrlListBox.Items.OfType<string>().Where(s => !string.IsNullOrWhiteSpace(s)).Distinct()); | |||||
LoadConfig(); | |||||
return; | |||||
} | |||||
private void AddButton_Click(object sender, EventArgs e) | |||||
{ | |||||
if (string.IsNullOrWhiteSpace(UrlTextBox.Text)) return; | |||||
UrlListBox.Items.Add(UrlTextBox.Text); | |||||
UrlListBox.SelectedIndex = UrlListBox.Items.Count - 1; | |||||
UrlTextBox.Text = ""; | |||||
Commit(); | |||||
} | |||||
private async void UpdateButton_Click(object sender, EventArgs e) | |||||
{ | |||||
string old = (string)UrlListBox.SelectedItem; | |||||
// update content, also update online config | |||||
Commit(); | |||||
string current = (string)UrlListBox.SelectedItem; | |||||
if (UrlListBox.Items.Count == 0) return; | |||||
tableLayoutPanel1.Enabled = false; | |||||
bool ok = await controller.UpdateOnlineConfig(current); | |||||
if (!ok) | |||||
{ | |||||
MessageBox.Show(I18N.GetString("online config failed to update")); | |||||
tableLayoutPanel1.Enabled = true; | |||||
return; | |||||
} | |||||
if (old != current) controller.RemoveOnlineConfig(old); | |||||
tableLayoutPanel1.Enabled = true; | |||||
} | |||||
private void UrlListBox_SelectedIndexChanged(object sender, EventArgs e) | |||||
{ | |||||
if (!UrlListBox.CanSelect) | |||||
{ | |||||
return; | |||||
} | |||||
SelectItem(); | |||||
} | |||||
private void DeleteButton_Click(object sender, EventArgs e) | |||||
{ | |||||
if (UrlListBox.Items.Count == 0) return; | |||||
string url = (string)UrlListBox.SelectedItem; | |||||
if (!string.IsNullOrWhiteSpace(url)) | |||||
{ | |||||
controller.RemoveOnlineConfig(url); | |||||
} | |||||
LoadConfig(); | |||||
} | |||||
private async void UpdateAllButton_Click(object sender, EventArgs e) | |||||
{ | |||||
if (UrlListBox.Items.Count == 0) return; | |||||
tableLayoutPanel1.Enabled = false; | |||||
int fail = await controller.UpdateAllOnlineConfig(); | |||||
if (fail > 0) | |||||
{ | |||||
MessageBox.Show(I18N.GetString("{0} online config failed to update", fail)); | |||||
} | |||||
tableLayoutPanel1.Enabled = true; | |||||
} | |||||
private void OkButton_Click(object sender, EventArgs e) | |||||
{ | |||||
Commit(); | |||||
Close(); | |||||
} | |||||
private void CancelButton_Click(object sender, EventArgs e) | |||||
{ | |||||
Close(); | |||||
} | |||||
} | |||||
} |
@@ -1,120 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<root> | |||||
<!-- | |||||
Microsoft ResX Schema | |||||
Version 2.0 | |||||
The primary goals of this format is to allow a simple XML format | |||||
that is mostly human readable. The generation and parsing of the | |||||
various data types are done through the TypeConverter classes | |||||
associated with the data types. | |||||
Example: | |||||
... ado.net/XML headers & schema ... | |||||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
<resheader name="version">2.0</resheader> | |||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
</data> | |||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
<comment>This is a comment</comment> | |||||
</data> | |||||
There are any number of "resheader" rows that contain simple | |||||
name/value pairs. | |||||
Each data row contains a name, and value. The row also contains a | |||||
type or mimetype. Type corresponds to a .NET class that support | |||||
text/value conversion through the TypeConverter architecture. | |||||
Classes that don't support this are serialized and stored with the | |||||
mimetype set. | |||||
The mimetype is used for serialized objects, and tells the | |||||
ResXResourceReader how to depersist the object. This is currently not | |||||
extensible. For a given mimetype the value must be set accordingly: | |||||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
that the ResXResourceWriter will generate, however the reader can | |||||
read any of the formats listed below. | |||||
mimetype: application/x-microsoft.net.object.binary.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.soap.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
value : The object must be serialized into a byte array | |||||
: using a System.ComponentModel.TypeConverter | |||||
: and then encoded with base64 encoding. | |||||
--> | |||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
<xsd:element name="root" msdata:IsDataSet="true"> | |||||
<xsd:complexType> | |||||
<xsd:choice maxOccurs="unbounded"> | |||||
<xsd:element name="metadata"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
<xsd:attribute name="type" type="xsd:string" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="assembly"> | |||||
<xsd:complexType> | |||||
<xsd:attribute name="alias" type="xsd:string" /> | |||||
<xsd:attribute name="name" type="xsd:string" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="data"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="resheader"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:choice> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:schema> | |||||
<resheader name="resmimetype"> | |||||
<value>text/microsoft-resx</value> | |||||
</resheader> | |||||
<resheader name="version"> | |||||
<value>2.0</value> | |||||
</resheader> | |||||
<resheader name="reader"> | |||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<resheader name="writer"> | |||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
</root> |
@@ -4,6 +4,7 @@ | |||||
<OutputType>WinExe</OutputType> | <OutputType>WinExe</OutputType> | ||||
<TargetFrameworks>netcoreapp3.1</TargetFrameworks> | <TargetFrameworks>netcoreapp3.1</TargetFrameworks> | ||||
<RootNamespace>Shadowsocks</RootNamespace> | <RootNamespace>Shadowsocks</RootNamespace> | ||||
<UseWPF>true</UseWPF> | |||||
<UseWindowsForms>true</UseWindowsForms> | <UseWindowsForms>true</UseWindowsForms> | ||||
<Authors>clowwindy & community 2020</Authors> | <Authors>clowwindy & community 2020</Authors> | ||||
<PackageId>Shadowsocks</PackageId> | <PackageId>Shadowsocks</PackageId> | ||||
@@ -76,22 +77,23 @@ | |||||
<PackageReference Include="Caseless.Fody" Version="1.9.0" /> | <PackageReference Include="Caseless.Fody" Version="1.9.0" /> | ||||
<PackageReference Include="CommandLineParser" Version="2.8.0" /> | <PackageReference Include="CommandLineParser" Version="2.8.0" /> | ||||
<PackageReference Include="Costura.Fody" Version="4.1.0" /> | <PackageReference Include="Costura.Fody" Version="4.1.0" /> | ||||
<PackageReference Include="Fody" Version="6.2.0"> | |||||
<PrivateAssets>all</PrivateAssets> | |||||
<PackageReference Include="Fody" Version="6.3.0"> | |||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
</PackageReference> | </PackageReference> | ||||
<PackageReference Include="Google.Protobuf" Version="3.12.3" /> | |||||
<PackageReference Include="Google.Protobuf" Version="3.13.0" /> | |||||
<PackageReference Include="MdXaml" Version="1.6.0" /> | |||||
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" /> | <PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" /> | ||||
<PackageReference Include="NaCl.Core" Version="1.2.0" /> | <PackageReference Include="NaCl.Core" Version="1.2.0" /> | ||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | ||||
<PackageReference Include="NLog" Version="4.7.2" /> | |||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.1" /> | |||||
<PackageReference Include="ZXing.Net" Version="0.16.5" /> | |||||
<PackageReference Include="StringEx.CS" Version="0.3.1"> | |||||
<PrivateAssets>all</PrivateAssets> | |||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |||||
</PackageReference> | |||||
<PackageReference Include="NLog" Version="4.7.5" /> | |||||
<PackageReference Include="ReactiveUI.Events.WPF" Version="11.5.35" /> | |||||
<PackageReference Include="ReactiveUI.Fody" Version="11.5.35" /> | |||||
<PackageReference Include="ReactiveUI.Validation" Version="1.8.1" /> | |||||
<PackageReference Include="ReactiveUI.WPF" Version="11.5.35" /> | |||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" /> | |||||
<PackageReference Include="WPFLocalizeExtension" Version="3.8.0" /> | |||||
<PackageReference Include="ZXing.Net" Version="0.16.6" /> | |||||
<PackageReference Include="System.Management" Version="4.7.0" /> | <PackageReference Include="System.Management" Version="4.7.0" /> | ||||
</ItemGroup> | </ItemGroup> | ||||