@@ -1,10 +0,0 @@ | |||
proxyAddress = "__POLIPO_BIND_IP__" | |||
proxyPort = 8123 | |||
socksParentProxy = "127.0.0.1:__SOCKS_PORT__" | |||
socksProxyType = socks5 | |||
diskCacheRoot = "" | |||
localDocumentRoot = "" | |||
allowedPorts = 1-65535 | |||
tunnelAllowedPorts = 1-65535 |
@@ -0,0 +1,5 @@ | |||
listen-address __POLIPO_BIND_IP__:__POLIPO_BIND_PORT__ | |||
show-on-task-bar 0 | |||
activity-animation 0 | |||
forward-socks5 / 127.0.0.1:__SOCKS_PORT__ . | |||
hide-console |
@@ -0,0 +1,282 @@ | |||
namespace Shadowsocks.View | |||
{ | |||
partial class ServerLogForm | |||
{ | |||
/// <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.components = new System.ComponentModel.Container(); | |||
this.ServerDataGrid = new System.Windows.Forms.DataGridView(); | |||
this.timer = new System.Windows.Forms.Timer(this.components); | |||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); | |||
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.Server = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.Enable = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.TotalConnect = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.Connecting = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.AvgLatency = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.AvgSpeed = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.MaxSpeed = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.Upload = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.Download = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.ErrorPercent = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.ConnectError = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.ConnectTimeout = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.ConnectNoData = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
this.Continuous = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
((System.ComponentModel.ISupportInitialize)(this.ServerDataGrid)).BeginInit(); | |||
this.tableLayoutPanel1.SuspendLayout(); | |||
this.SuspendLayout(); | |||
// | |||
// ServerDataGrid | |||
// | |||
this.ServerDataGrid.AllowUserToAddRows = false; | |||
this.ServerDataGrid.AllowUserToDeleteRows = false; | |||
this.ServerDataGrid.AllowUserToResizeRows = false; | |||
this.ServerDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; | |||
this.ServerDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; | |||
this.ServerDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { | |||
this.ID, | |||
this.Server, | |||
this.Enable, | |||
this.TotalConnect, | |||
this.Connecting, | |||
this.AvgLatency, | |||
this.AvgSpeed, | |||
this.MaxSpeed, | |||
this.Upload, | |||
this.Download, | |||
this.ErrorPercent, | |||
this.ConnectError, | |||
this.ConnectTimeout, | |||
this.ConnectNoData, | |||
this.Continuous}); | |||
this.ServerDataGrid.Dock = System.Windows.Forms.DockStyle.Fill; | |||
this.ServerDataGrid.Location = new System.Drawing.Point(0, 0); | |||
this.ServerDataGrid.Margin = new System.Windows.Forms.Padding(0); | |||
this.ServerDataGrid.MinimumSize = new System.Drawing.Size(1, 1); | |||
this.ServerDataGrid.MultiSelect = false; | |||
this.ServerDataGrid.Name = "ServerDataGrid"; | |||
this.ServerDataGrid.ReadOnly = true; | |||
this.ServerDataGrid.RowHeadersVisible = false; | |||
this.ServerDataGrid.RowTemplate.Height = 23; | |||
this.ServerDataGrid.Size = new System.Drawing.Size(117, 48); | |||
this.ServerDataGrid.TabIndex = 0; | |||
this.ServerDataGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ServerDataGrid_CellClick); | |||
this.ServerDataGrid.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ServerDataGrid_CellDoubleClick); | |||
this.ServerDataGrid.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.ServerDataGrid_SortCompare); | |||
this.ServerDataGrid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ServerDataGrid_MouseUp); | |||
// | |||
// timer | |||
// | |||
this.timer.Enabled = true; | |||
this.timer.Interval = 250; | |||
this.timer.Tick += new System.EventHandler(this.timer_Tick); | |||
// | |||
// tableLayoutPanel1 | |||
// | |||
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; | |||
this.tableLayoutPanel1.ColumnCount = 1; | |||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||
this.tableLayoutPanel1.Controls.Add(this.ServerDataGrid, 0, 0); | |||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; | |||
this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize; | |||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); | |||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); | |||
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; | |||
this.tableLayoutPanel1.RowCount = 1; | |||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||
this.tableLayoutPanel1.Size = new System.Drawing.Size(116, 48); | |||
this.tableLayoutPanel1.TabIndex = 1; | |||
// | |||
// ID | |||
// | |||
this.ID.HeaderText = "ID"; | |||
this.ID.MinimumWidth = 2; | |||
this.ID.Name = "ID"; | |||
this.ID.ReadOnly = true; | |||
this.ID.Width = 28; | |||
// | |||
// Server | |||
// | |||
this.Server.HeaderText = "Server"; | |||
this.Server.MinimumWidth = 2; | |||
this.Server.Name = "Server"; | |||
this.Server.ReadOnly = true; | |||
this.Server.Width = 200; | |||
// | |||
// Enable | |||
// | |||
this.Enable.HeaderText = "Enable"; | |||
this.Enable.MinimumWidth = 2; | |||
this.Enable.Name = "Enable"; | |||
this.Enable.ReadOnly = true; | |||
this.Enable.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; | |||
this.Enable.Width = 28; | |||
// | |||
// TotalConnect | |||
// | |||
this.TotalConnect.HeaderText = "Total Connect"; | |||
this.TotalConnect.MinimumWidth = 2; | |||
this.TotalConnect.Name = "TotalConnect"; | |||
this.TotalConnect.ReadOnly = true; | |||
this.TotalConnect.Visible = false; | |||
this.TotalConnect.Width = 48; | |||
// | |||
// Connecting | |||
// | |||
this.Connecting.HeaderText = "Connecting"; | |||
this.Connecting.MinimumWidth = 2; | |||
this.Connecting.Name = "Connecting"; | |||
this.Connecting.ReadOnly = true; | |||
this.Connecting.Width = 28; | |||
// | |||
// AvgLatency | |||
// | |||
this.AvgLatency.HeaderText = "Latency"; | |||
this.AvgLatency.MinimumWidth = 2; | |||
this.AvgLatency.Name = "AvgLatency"; | |||
this.AvgLatency.ReadOnly = true; | |||
this.AvgLatency.Width = 48; | |||
// | |||
// AvgSpeed | |||
// | |||
this.AvgSpeed.HeaderText = "Avg Speed"; | |||
this.AvgSpeed.MinimumWidth = 2; | |||
this.AvgSpeed.Name = "AvgSpeed"; | |||
this.AvgSpeed.ReadOnly = true; | |||
this.AvgSpeed.Width = 72; | |||
// | |||
// MaxSpeed | |||
// | |||
this.MaxSpeed.HeaderText = "Max Speed"; | |||
this.MaxSpeed.MinimumWidth = 2; | |||
this.MaxSpeed.Name = "MaxSpeed"; | |||
this.MaxSpeed.ReadOnly = true; | |||
this.MaxSpeed.Width = 72; | |||
// | |||
// Upload | |||
// | |||
this.Upload.HeaderText = "Upload"; | |||
this.Upload.MinimumWidth = 2; | |||
this.Upload.Name = "Upload"; | |||
this.Upload.ReadOnly = true; | |||
this.Upload.Width = 72; | |||
// | |||
// Download | |||
// | |||
this.Download.HeaderText = "Download"; | |||
this.Download.MinimumWidth = 2; | |||
this.Download.Name = "Download"; | |||
this.Download.ReadOnly = true; | |||
this.Download.Width = 72; | |||
// | |||
// ErrorPercent | |||
// | |||
this.ErrorPercent.HeaderText = "Error Percent"; | |||
this.ErrorPercent.MinimumWidth = 2; | |||
this.ErrorPercent.Name = "ErrorPercent"; | |||
this.ErrorPercent.ReadOnly = true; | |||
this.ErrorPercent.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; | |||
this.ErrorPercent.Width = 60; | |||
// | |||
// ConnectError | |||
// | |||
this.ConnectError.HeaderText = "Error"; | |||
this.ConnectError.MinimumWidth = 2; | |||
this.ConnectError.Name = "ConnectError"; | |||
this.ConnectError.ReadOnly = true; | |||
this.ConnectError.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; | |||
this.ConnectError.Visible = false; | |||
this.ConnectError.Width = 28; | |||
// | |||
// ConnectTimeout | |||
// | |||
this.ConnectTimeout.HeaderText = "Timeout"; | |||
this.ConnectTimeout.MinimumWidth = 2; | |||
this.ConnectTimeout.Name = "ConnectTimeout"; | |||
this.ConnectTimeout.ReadOnly = true; | |||
this.ConnectTimeout.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; | |||
this.ConnectTimeout.Visible = false; | |||
this.ConnectTimeout.Width = 28; | |||
// | |||
// ConnectNoData | |||
// | |||
this.ConnectNoData.HeaderText = "NoData"; | |||
this.ConnectNoData.MinimumWidth = 2; | |||
this.ConnectNoData.Name = "ConnectNoData"; | |||
this.ConnectNoData.ReadOnly = true; | |||
this.ConnectNoData.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; | |||
this.ConnectNoData.Visible = false; | |||
this.ConnectNoData.Width = 28; | |||
// | |||
// Continuous | |||
// | |||
this.Continuous.HeaderText = "Continuous"; | |||
this.Continuous.Name = "Continuous"; | |||
this.Continuous.ReadOnly = true; | |||
this.Continuous.Width = 28; | |||
// | |||
// ServerLogForm | |||
// | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(116, 48); | |||
this.Controls.Add(this.tableLayoutPanel1); | |||
this.Font = new System.Drawing.Font("NSimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); | |||
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); | |||
this.Name = "ServerLogForm"; | |||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | |||
this.Text = "ServerLog"; | |||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ServerLogForm_FormClosed); | |||
((System.ComponentModel.ISupportInitialize)(this.ServerDataGrid)).EndInit(); | |||
this.tableLayoutPanel1.ResumeLayout(false); | |||
this.ResumeLayout(false); | |||
} | |||
#endregion | |||
private System.Windows.Forms.DataGridView ServerDataGrid; | |||
private System.Windows.Forms.Timer timer; | |||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn ID; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn Server; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn Enable; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn TotalConnect; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn Connecting; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn AvgLatency; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn AvgSpeed; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn MaxSpeed; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn Upload; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn Download; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn ErrorPercent; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn ConnectError; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn ConnectTimeout; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn ConnectNoData; | |||
private System.Windows.Forms.DataGridViewTextBoxColumn Continuous; | |||
} | |||
} |
@@ -0,0 +1,616 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Data; | |||
using System.Drawing; | |||
using System.Text; | |||
using System.Windows.Forms; | |||
using Shadowsocks.Controller; | |||
using Shadowsocks.Model; | |||
using Shadowsocks.Properties; | |||
using System.Threading; | |||
namespace Shadowsocks.View | |||
{ | |||
public partial class ServerLogForm : Form | |||
{ | |||
private ShadowsocksController controller; | |||
private ContextMenu contextMenu1; | |||
private MenuItem clearItem; | |||
private List<int> listOrder = new List<int>(); | |||
private int lastRefreshIndex = 0; | |||
private bool rowChange = false; | |||
private ServerSpeedLogShow[] ServerSpeedLogList; | |||
private Thread workerThread; | |||
public ServerLogForm(ShadowsocksController controller) | |||
{ | |||
this.controller = controller; | |||
this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon()); | |||
InitializeComponent(); | |||
this.Width = 760; | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
if (config.configs.Count < 8) | |||
{ | |||
this.Height = 300; | |||
} | |||
else if (config.configs.Count < 20) | |||
{ | |||
this.Height = 300 + (config.configs.Count - 8) * 16; | |||
} | |||
else | |||
{ | |||
this.Height = 500; | |||
} | |||
UpdateTexts(); | |||
UpdateLog(); | |||
this.contextMenu1 = new ContextMenu(new MenuItem[] { | |||
this.clearItem = CreateMenuItem("&Clear", new EventHandler(this.ClearItem_Click)), | |||
}); | |||
ServerDataGrid.ContextMenu = contextMenu1; | |||
controller.ConfigChanged += controller_ConfigChanged; | |||
} | |||
private MenuItem CreateMenuItem(string text, EventHandler click) | |||
{ | |||
return new MenuItem(I18N.GetString(text), click); | |||
} | |||
private void UpdateTitle() | |||
{ | |||
this.Text = I18N.GetString("ServerLog") + "(" | |||
+ (controller.GetCurrentConfiguration().shareOverLan ? "any" : "local") + ":" + controller.GetCurrentConfiguration().localPort.ToString() | |||
+ I18N.GetString(" Version") + UpdateChecker.Version | |||
+ ")"; | |||
} | |||
private void UpdateTexts() | |||
{ | |||
UpdateTitle(); | |||
for (int i = 0; i < ServerDataGrid.Columns.Count; ++i) | |||
{ | |||
ServerDataGrid.Columns[i].HeaderText = I18N.GetString(ServerDataGrid.Columns[i].HeaderText); | |||
} | |||
} | |||
private void controller_ConfigChanged(object sender, EventArgs e) | |||
{ | |||
UpdateTitle(); | |||
} | |||
private string FormatBytes(long bytes) | |||
{ | |||
const long K = 1024L; | |||
const long M = K * 1024L; | |||
const long G = M * 1024L; | |||
const long T = G * 1024L; | |||
const long P = T * 1024L; | |||
const long E = P * 1024L; | |||
if (bytes >= E * 2) | |||
return (bytes / (double)E).ToString("F5") + "E"; | |||
if (bytes >= P * 2) | |||
return (bytes / (double)P).ToString("F5") + "P"; | |||
if (bytes >= T * 2) | |||
return (bytes / (double)T).ToString("F5") + "T"; | |||
if (bytes >= G * 2) | |||
{ | |||
return (bytes / (double)G).ToString("F4") + "G"; | |||
} | |||
if (bytes >= K * 990) | |||
{ | |||
return (bytes / (double)M).ToString("F4") + "M"; | |||
} | |||
if (bytes > K * 2) | |||
{ | |||
return (bytes / (double)K).ToString("F3") + "K"; | |||
} | |||
return bytes.ToString(); | |||
} | |||
public bool SetBackColor(DataGridViewCell cell, Color newColor) | |||
{ | |||
if (cell.Style.BackColor != newColor) | |||
{ | |||
cell.Style.BackColor = newColor; | |||
rowChange = true; | |||
return true; | |||
} | |||
return false; | |||
} | |||
public bool SetCellText(DataGridViewCell cell, string newString) | |||
{ | |||
if ((string)cell.Value != newString) | |||
{ | |||
cell.Value = newString; | |||
rowChange = true; | |||
return true; | |||
} | |||
return false; | |||
} | |||
public bool SetCellText(DataGridViewCell cell, long newInteger) | |||
{ | |||
if ((string)cell.Value != newInteger.ToString()) | |||
{ | |||
cell.Value = newInteger.ToString(); | |||
rowChange = true; | |||
return true; | |||
} | |||
return false; | |||
} | |||
byte ColorMix(byte a, byte b, double alpha) | |||
{ | |||
return (byte)(b * alpha + a * (1 - alpha)); | |||
} | |||
Color ColorMix(Color a, Color b, double alpha) | |||
{ | |||
return Color.FromArgb(ColorMix(a.R, b.R, alpha), | |||
ColorMix(a.G, b.G, alpha), | |||
ColorMix(a.B, b.B, alpha)); | |||
} | |||
public void UpdateLogThread() | |||
{ | |||
while (workerThread != null) | |||
{ | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
ServerSpeedLogShow[] _ServerSpeedLogList = new ServerSpeedLogShow[config.configs.Count]; | |||
for (int i = 0; i < config.configs.Count; ++i) | |||
{ | |||
_ServerSpeedLogList[i] = config.configs[i].ServerSpeedLog().Translate(); | |||
} | |||
ServerSpeedLogList = _ServerSpeedLogList; | |||
workerThread.Suspend(); | |||
} | |||
} | |||
public void UpdateLog() | |||
{ | |||
if (workerThread == null) | |||
{ | |||
workerThread = new Thread(this.UpdateLogThread); | |||
workerThread.Start(); | |||
} | |||
else | |||
{ | |||
try | |||
{ | |||
workerThread.Resume(); | |||
} | |||
catch | |||
{ | |||
} | |||
} | |||
} | |||
public void RefreshLog() | |||
{ | |||
if (ServerSpeedLogList == null) | |||
return; | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
if (listOrder.Count > config.configs.Count) | |||
{ | |||
listOrder.RemoveRange(config.configs.Count, listOrder.Count - config.configs.Count); | |||
} | |||
while (listOrder.Count < config.configs.Count) | |||
{ | |||
listOrder.Add(0); | |||
} | |||
while (ServerDataGrid.Rows.Count < config.configs.Count) | |||
{ | |||
ServerDataGrid.Rows.Add(); | |||
int id = ServerDataGrid.Rows.Count - 1; | |||
ServerDataGrid[0, id].Value = id; | |||
} | |||
if (ServerDataGrid.Rows.Count > config.configs.Count) | |||
{ | |||
for (int list_index = 0; list_index < ServerDataGrid.Rows.Count; ++list_index) | |||
{ | |||
DataGridViewCell id_cell = ServerDataGrid[0, list_index]; | |||
int id = (int)id_cell.Value; | |||
if (id >= config.configs.Count) | |||
{ | |||
ServerDataGrid.Rows.RemoveAt(list_index); | |||
--list_index; | |||
} | |||
} | |||
} | |||
//int index = 0; | |||
//foreach (Server server in config.configs) | |||
//for ( int id = 0; id < config.configs.Count; ++id) | |||
try | |||
{ | |||
for (int list_index = (lastRefreshIndex >= ServerDataGrid.Rows.Count) ? 0 : lastRefreshIndex, rowChangeCnt = 0; | |||
list_index < ServerDataGrid.Rows.Count && rowChangeCnt <= 200; | |||
++list_index, ++rowChangeCnt) | |||
{ | |||
lastRefreshIndex = list_index + 1; | |||
DataGridViewCell id_cell = ServerDataGrid[0, list_index]; | |||
int id = (int)id_cell.Value; | |||
Server server = config.configs[id]; | |||
ServerSpeedLogShow serverSpeedLog = ServerSpeedLogList[id]; | |||
const byte colAdd = 2; | |||
listOrder[id] = list_index; | |||
rowChange = false; | |||
for (int curcol = 0; curcol < ServerDataGrid.Columns.Count; ++curcol) | |||
{ | |||
DataGridViewCell cell = ServerDataGrid[curcol, list_index]; | |||
string columnName = ServerDataGrid.Columns[curcol].Name; | |||
// Server | |||
if (columnName == "Server") | |||
{ | |||
if (config.index == id) | |||
SetBackColor(cell, Color.Cyan); | |||
else | |||
SetBackColor(cell, Color.White); | |||
SetCellText(cell, server.FriendlyName()); | |||
} | |||
// Enable | |||
if (columnName == "Enable") | |||
{ | |||
if (server.isEnable()) | |||
SetBackColor(cell, Color.White); | |||
else | |||
SetBackColor(cell, Color.Red); | |||
} | |||
// TotalConnectTimes | |||
else if (columnName == "TotalConnect") | |||
{ | |||
SetCellText(cell, serverSpeedLog.totalConnectTimes); | |||
} | |||
// TotalConnecting | |||
else if (columnName == "Connecting") | |||
{ | |||
SetCellText(cell, server.GetConnections().Count); | |||
//SetCellText(cell, serverSpeedLog.totalConnectTimes - serverSpeedLog.totalDisconnectTimes); | |||
} | |||
// AvgConnectTime | |||
else if (columnName == "AvgLatency") | |||
{ | |||
if (serverSpeedLog.avgConnectTime >= 0) | |||
SetCellText(cell, serverSpeedLog.avgConnectTime); | |||
else | |||
SetCellText(cell, "-"); | |||
} | |||
// AvgSpeed | |||
else if (columnName == "AvgSpeed") | |||
{ | |||
long avgBytes = serverSpeedLog.avgDownloadBytes; | |||
string valStr = FormatBytes(avgBytes); | |||
Color[] colList = new Color[6] { Color.White, Color.LightGreen, Color.Yellow, Color.Pink, Color.Red, Color.Red }; | |||
long[] bytesList = new long[6] { 0, 1024 * 64, 1024 * 512, 1024 * 1024 * 4, 1024 * 1024 * 16, 1024 * 1024 * 1024 }; | |||
for (int i = 1; i < colList.Length; ++i) | |||
{ | |||
if (avgBytes < bytesList[i]) | |||
{ | |||
SetBackColor(cell, | |||
ColorMix(colList[i - 1], | |||
colList[i], | |||
(double)(avgBytes - bytesList[i - 1]) / (bytesList[i] - bytesList[i - 1]) | |||
) | |||
); | |||
break; | |||
} | |||
} | |||
SetCellText(cell, valStr); | |||
} | |||
// MaxSpeed | |||
else if (columnName == "MaxSpeed") | |||
{ | |||
long maxBytes = serverSpeedLog.maxDownloadBytes; | |||
string valStr = FormatBytes(maxBytes); | |||
Color[] colList = new Color[6] { Color.White, Color.LightGreen, Color.Yellow, Color.Pink, Color.Red, Color.Red }; | |||
long[] bytesList = new long[6] { 0, 1024 * 64, 1024 * 512, 1024 * 1024 * 4, 1024 * 1024 * 16, 1024 * 1024 * 1024 }; | |||
for (int i = 1; i < colList.Length; ++i) | |||
{ | |||
if (maxBytes < bytesList[i]) | |||
{ | |||
SetBackColor(cell, | |||
ColorMix(colList[i - 1], | |||
colList[i], | |||
(double)(maxBytes - bytesList[i - 1]) / (bytesList[i] - bytesList[i - 1]) | |||
) | |||
); | |||
break; | |||
} | |||
} | |||
SetCellText(cell, valStr); | |||
} | |||
// TotalUploadBytes | |||
else if (columnName == "Upload") | |||
{ | |||
string valStr = FormatBytes(serverSpeedLog.totalUploadBytes); | |||
if ((string)cell.Value != valStr) | |||
{ | |||
if (valStr == "0") | |||
SetBackColor(cell, Color.White); | |||
else | |||
{ | |||
SetBackColor(cell, Color.LightGreen); | |||
cell.Tag = 8; | |||
} | |||
} | |||
else if (cell.Tag != null) | |||
{ | |||
cell.Tag = (int)cell.Tag - 1; | |||
if ((int)cell.Tag == 0) SetBackColor(cell, Color.White); | |||
//Color col = cell.Style.BackColor; | |||
//SetBackColor(cell, Color.FromArgb(Math.Min(255, col.R + colAdd), Math.Min(255, col.G + colAdd), Math.Min(255, col.B + colAdd))); | |||
} | |||
SetCellText(cell, valStr); | |||
} | |||
// TotalDownloadBytes | |||
else if (columnName == "Download") | |||
{ | |||
string valStr = FormatBytes(serverSpeedLog.totalDownloadBytes); | |||
if ((string)cell.Value != valStr) | |||
{ | |||
if (valStr == "0") | |||
SetBackColor(cell, Color.White); | |||
else | |||
{ | |||
SetBackColor(cell, Color.LightGreen); | |||
cell.Tag = 8; | |||
} | |||
} | |||
else if (cell.Tag != null) | |||
{ | |||
cell.Tag = (int)cell.Tag - 1; | |||
if ((int)cell.Tag == 0) SetBackColor(cell, Color.White); | |||
//Color col = cell.Style.BackColor; | |||
//SetBackColor(cell, Color.FromArgb(Math.Min(255, col.R + colAdd), Math.Min(255, col.G + colAdd), Math.Min(255, col.B + colAdd))); | |||
} | |||
SetCellText(cell, valStr); | |||
} | |||
// ErrorConnectTimes | |||
else if (columnName == "ConnectError") | |||
{ | |||
SetCellText(cell, serverSpeedLog.errorConnectTimes); | |||
} | |||
// ErrorTimeoutTimes | |||
else if (columnName == "ConnectTimeout") | |||
{ | |||
SetCellText(cell, serverSpeedLog.errorTimeoutTimes); | |||
} | |||
// ErrorTimeoutTimes | |||
else if (columnName == "ConnectNoData") | |||
{ | |||
long val = serverSpeedLog.errorNoDataTimes; | |||
Color col = Color.FromArgb(255, (byte)Math.Max(0, 255 - val * 8), (byte)Math.Max(0, 255 - val * 8)); | |||
SetBackColor(cell, col); | |||
SetCellText(cell, val); | |||
} | |||
// ErrorTimeoutTimes | |||
else if (columnName == "Continuous") | |||
{ | |||
long val = serverSpeedLog.errorContinurousTimes; | |||
Color col = Color.FromArgb(255, (byte)Math.Max(0, 255 - val * 8), (byte)Math.Max(0, 255 - val * 8)); | |||
SetBackColor(cell, col); | |||
SetCellText(cell, val); | |||
} | |||
// ErrorPersent | |||
else if (columnName == "ErrorPercent") | |||
{ | |||
if (serverSpeedLog.totalConnectTimes > 0) | |||
{ | |||
double percent = (serverSpeedLog.errorConnectTimes | |||
+ serverSpeedLog.errorTimeoutTimes | |||
+ serverSpeedLog.errorNoDataTimes) | |||
* 100.00 / serverSpeedLog.totalConnectTimes; | |||
SetBackColor(cell, Color.FromArgb(255, (byte)(255 - percent * 2), (byte)(255 - percent * 2))); | |||
if (percent < 1e-4) | |||
SetCellText(cell, percent.ToString("F0") + "%"); | |||
else | |||
SetCellText(cell, percent.ToString("F2") + "%"); | |||
} | |||
else | |||
{ | |||
SetBackColor(cell, Color.White); | |||
SetCellText(cell, "-"); | |||
} | |||
} | |||
if (columnName == "Server") | |||
{ | |||
if (cell.Style.Alignment != DataGridViewContentAlignment.MiddleLeft) | |||
cell.Style.Alignment = DataGridViewContentAlignment.MiddleLeft; | |||
} | |||
else | |||
{ | |||
if (cell.Style.Alignment != DataGridViewContentAlignment.MiddleRight) | |||
cell.Style.Alignment = DataGridViewContentAlignment.MiddleRight; | |||
} | |||
} | |||
if (rowChange) | |||
rowChangeCnt++; | |||
} | |||
} | |||
catch | |||
{ | |||
} | |||
if (ServerDataGrid.SortedColumn != null) | |||
{ | |||
ServerDataGrid.Sort(ServerDataGrid.SortedColumn, (ListSortDirection)((int)ServerDataGrid.SortOrder - 1)); | |||
} | |||
} | |||
private void ClearItem_Click(object sender, EventArgs e) | |||
{ | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
foreach (Server server in config.configs) | |||
{ | |||
server.ServerSpeedLog().Clear(); | |||
} | |||
} | |||
private void timer_Tick(object sender, EventArgs e) | |||
{ | |||
RefreshLog(); | |||
UpdateLog(); | |||
} | |||
private void ServerDataGrid_MouseUp(object sender, MouseEventArgs e) | |||
{ | |||
if (e.Button == MouseButtons.Right) | |||
{ | |||
contextMenu1.Show(ServerDataGrid, new Point(e.X, e.Y)); | |||
} | |||
} | |||
private void ServerDataGrid_CellClick(object sender, DataGridViewCellEventArgs e) | |||
{ | |||
if (e.RowIndex >= 0) | |||
{ | |||
int id = (int)ServerDataGrid[0, e.RowIndex].Value; | |||
if (ServerDataGrid.Columns[e.ColumnIndex].Name == "Server") | |||
{ | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
controller.SelectServerIndex(id); | |||
} | |||
if (ServerDataGrid.Columns[e.ColumnIndex].Name == "Enable") | |||
{ | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
Server server = config.configs[id]; | |||
server.setEnable(!server.isEnable()); | |||
} | |||
ServerDataGrid[0, e.RowIndex].Selected = true; | |||
} | |||
} | |||
private void ServerDataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) | |||
{ | |||
if (e.RowIndex >= 0) | |||
{ | |||
int id = (int)ServerDataGrid[0, e.RowIndex].Value; | |||
if (ServerDataGrid.Columns[e.ColumnIndex].Name == "Server") | |||
{ | |||
controller.ShowConfigForm(); | |||
} | |||
if (ServerDataGrid.Columns[e.ColumnIndex].Name == "Connecting") | |||
{ | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
Server server = config.configs[id]; | |||
server.GetConnections().CloseAll(); | |||
} | |||
if (ServerDataGrid.Columns[e.ColumnIndex].Name == "ErrorPercent") | |||
{ | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
config.configs[id].ServerSpeedLog().Clear(); | |||
config.configs[id].setEnable(true); | |||
} | |||
if (ServerDataGrid.Columns[e.ColumnIndex].Name == "ConnectError" | |||
|| ServerDataGrid.Columns[e.ColumnIndex].Name == "ConnectTimeout" | |||
|| ServerDataGrid.Columns[e.ColumnIndex].Name == "ConnectNoData" | |||
|| ServerDataGrid.Columns[e.ColumnIndex].Name == "Continuous" | |||
) | |||
{ | |||
Configuration config = controller.GetCurrentConfiguration(); | |||
config.configs[id].ServerSpeedLog().ClearError(); | |||
config.configs[id].setEnable(true); | |||
} | |||
ServerDataGrid[0, e.RowIndex].Selected = true; | |||
} | |||
} | |||
private void ServerLogForm_FormClosed(object sender, FormClosedEventArgs e) | |||
{ | |||
controller.ConfigChanged -= controller_ConfigChanged; | |||
Thread thread = workerThread; | |||
workerThread = null; | |||
thread.Resume(); | |||
} | |||
private long Str2Long(String str) | |||
{ | |||
if (str == "-") return -1; | |||
if (str.LastIndexOf('K') > 0) | |||
{ | |||
Double ret = Convert.ToDouble(str.Substring(0, str.LastIndexOf('K'))); | |||
return (long)(ret * 1024); | |||
} | |||
if (str.LastIndexOf('M') > 0) | |||
{ | |||
Double ret = Convert.ToDouble(str.Substring(0, str.LastIndexOf('M'))); | |||
return (long)(ret * 1024 * 1024); | |||
} | |||
if (str.LastIndexOf('G') > 0) | |||
{ | |||
Double ret = Convert.ToDouble(str.Substring(0, str.LastIndexOf('G'))); | |||
return (long)(ret * 1024 * 1024 * 1024); | |||
} | |||
if (str.LastIndexOf('T') > 0) | |||
{ | |||
Double ret = Convert.ToDouble(str.Substring(0, str.LastIndexOf('T'))); | |||
return (long)(ret * 1024 * 1024 * 1024 * 1024); | |||
} | |||
try | |||
{ | |||
Double ret = Convert.ToDouble(str); | |||
return (long)ret; | |||
} | |||
catch | |||
{ | |||
return -1; | |||
} | |||
} | |||
private void ServerDataGrid_SortCompare(object sender, DataGridViewSortCompareEventArgs e) | |||
{ | |||
//e.SortResult = 0; | |||
if (e.Column.Name == "Server") | |||
{ | |||
e.SortResult = System.String.Compare(Convert.ToString(e.CellValue1), Convert.ToString(e.CellValue2)); | |||
e.Handled = true; | |||
} | |||
else if (e.Column.Name == "ID" | |||
|| e.Column.Name == "TotalConnect" | |||
|| e.Column.Name == "Connecting" | |||
|| e.Column.Name == "ConnectError" | |||
|| e.Column.Name == "ConnectTimeout" | |||
|| e.Column.Name == "ConnectNoData" | |||
|| e.Column.Name == "Continuous" | |||
) | |||
{ | |||
Int32 v1 = Convert.ToInt32(e.CellValue1); | |||
Int32 v2 = Convert.ToInt32(e.CellValue2); | |||
e.SortResult = (v1 == v2 ? 0 : (v1 < v2 ? -1 : 1)); | |||
} | |||
else if (e.Column.Name == "ErrorPercent") | |||
{ | |||
String s1 = Convert.ToString(e.CellValue1); | |||
String s2 = Convert.ToString(e.CellValue2); | |||
Int32 v1 = s1.Length <= 1 ? 0 : Convert.ToInt32(Convert.ToDouble(s1.Substring(0, s1.Length - 1)) * 100); | |||
Int32 v2 = s2.Length <= 1 ? 0 : Convert.ToInt32(Convert.ToDouble(s2.Substring(0, s2.Length - 1)) * 100); | |||
e.SortResult = v1 == v2 ? 0 : v1 < v2 ? -1 : 1; | |||
} | |||
else if (e.Column.Name == "AvgLatency" | |||
|| e.Column.Name == "AvgSpeed" | |||
|| e.Column.Name == "MaxSpeed" | |||
|| e.Column.Name == "Upload" | |||
|| e.Column.Name == "Download" | |||
) | |||
{ | |||
String s1 = Convert.ToString(e.CellValue1); | |||
String s2 = Convert.ToString(e.CellValue2); | |||
long v1 = Str2Long(s1); | |||
long v2 = Str2Long(s2); | |||
e.SortResult = (v1 == v2 ? 0 : (v1 < v2 ? -1 : 1)); | |||
} | |||
if (e.SortResult == 0) | |||
{ | |||
int v1 = listOrder[Convert.ToInt32(ServerDataGrid[0, e.RowIndex1].Value)]; | |||
int v2 = listOrder[Convert.ToInt32(ServerDataGrid[0, e.RowIndex2].Value)]; | |||
e.SortResult = (v1 == v2 ? 0 : (v1 < v2 ? -1 : 1)); | |||
if (e.SortResult != 0 && ServerDataGrid.SortOrder == SortOrder.Descending) | |||
{ | |||
e.SortResult = -e.SortResult; | |||
} | |||
} | |||
if (e.SortResult != 0) | |||
{ | |||
e.Handled = true; | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,168 @@ | |||
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="Server.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="Enable.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="TotalConnect.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="Connecting.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="AvgLatency.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="AvgSpeed.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="MaxSpeed.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="Upload.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="Download.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="ErrorPercent.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="ConnectError.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="ConnectTimeout.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="ConnectNoData.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="Continuous.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>True</value> | |||
</metadata> | |||
<metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>17, 17</value> | |||
</metadata> | |||
</root> |
@@ -0,0 +1,257 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<PropertyGroup> | |||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||
<ProductVersion>9.0.21022</ProductVersion> | |||
<SchemaVersion>2.0</SchemaVersion> | |||
<ProjectGuid>{0F2A0C8A-6C06-485B-AA13-AEEC19CA9637}</ProjectGuid> | |||
<OutputType>WinExe</OutputType> | |||
<AppDesignerFolder>Properties</AppDesignerFolder> | |||
<RootNamespace>Shadowsocks</RootNamespace> | |||
<AssemblyName>ShadowsocksR</AssemblyName> | |||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | |||
<FileAlignment>512</FileAlignment> | |||
<StartupObject> | |||
</StartupObject> | |||
<ApplicationIcon>shadowsocks.ico</ApplicationIcon> | |||
<IsWebBootstrapper>false</IsWebBootstrapper> | |||
<FileUpgradeFlags> | |||
</FileUpgradeFlags> | |||
<UpgradeBackupLocation> | |||
</UpgradeBackupLocation> | |||
<OldToolsVersion>3.5</OldToolsVersion> | |||
<TargetFrameworkProfile> | |||
</TargetFrameworkProfile> | |||
<PublishUrl>publish\</PublishUrl> | |||
<Install>true</Install> | |||
<InstallFrom>Disk</InstallFrom> | |||
<UpdateEnabled>false</UpdateEnabled> | |||
<UpdateMode>Foreground</UpdateMode> | |||
<UpdateInterval>7</UpdateInterval> | |||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> | |||
<UpdatePeriodically>false</UpdatePeriodically> | |||
<UpdateRequired>false</UpdateRequired> | |||
<MapFileExtensions>true</MapFileExtensions> | |||
<ApplicationRevision>1</ApplicationRevision> | |||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> | |||
<UseApplicationTrust>false</UseApplicationTrust> | |||
<BootstrapperEnabled>true</BootstrapperEnabled> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> | |||
<DebugSymbols>true</DebugSymbols> | |||
<OutputPath>bin\Net4.0x86\Debug\</OutputPath> | |||
<DefineConstants>TRACE;DEBUG</DefineConstants> | |||
<DebugType>full</DebugType> | |||
<PlatformTarget>x86</PlatformTarget> | |||
<ErrorReport>prompt</ErrorReport> | |||
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> | |||
<Prefer32Bit>false</Prefer32Bit> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> | |||
<OutputPath>bin\Net4.0x86\Release\</OutputPath> | |||
<DefineConstants>TRACE</DefineConstants> | |||
<Optimize>true</Optimize> | |||
<DebugType>pdbonly</DebugType> | |||
<PlatformTarget>x86</PlatformTarget> | |||
<ErrorReport>prompt</ErrorReport> | |||
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> | |||
<Prefer32Bit>false</Prefer32Bit> | |||
<DebugSymbols>true</DebugSymbols> | |||
</PropertyGroup> | |||
<PropertyGroup> | |||
<ApplicationManifest>app.manifest</ApplicationManifest> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<Reference Include="Microsoft.VisualBasic" /> | |||
<Reference Include="System" /> | |||
<Reference Include="System.Data" /> | |||
<Reference Include="System.Drawing" /> | |||
<Reference Include="System.Windows.Forms" /> | |||
<Reference Include="System.XML" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="3rd\zxing\BarcodeFormat.cs" /> | |||
<Compile Include="3rd\zxing\BaseLuminanceSource.cs" /> | |||
<Compile Include="3rd\zxing\Binarizer.cs" /> | |||
<Compile Include="3rd\zxing\BinaryBitmap.cs" /> | |||
<Compile Include="3rd\zxing\BitmapLuminanceSource.cs" /> | |||
<Compile Include="3rd\zxing\common\BitArray.cs" /> | |||
<Compile Include="3rd\zxing\common\BitMatrix.cs" /> | |||
<Compile Include="3rd\zxing\common\BitSource.cs" /> | |||
<Compile Include="3rd\zxing\common\DecoderResult.cs" /> | |||
<Compile Include="3rd\zxing\common\DefaultGridSampler.cs" /> | |||
<Compile Include="3rd\zxing\common\DetectorResult.cs" /> | |||
<Compile Include="3rd\zxing\common\detector\MathUtils.cs" /> | |||
<Compile Include="3rd\zxing\common\GlobalHistogramBinarizer.cs" /> | |||
<Compile Include="3rd\zxing\common\GridSampler.cs" /> | |||
<Compile Include="3rd\zxing\common\HybridBinarizer.cs" /> | |||
<Compile Include="3rd\zxing\common\PerspectiveTransform.cs" /> | |||
<Compile Include="3rd\zxing\common\reedsolomon\GenericGF.cs" /> | |||
<Compile Include="3rd\zxing\common\reedsolomon\GenericGFPoly.cs" /> | |||
<Compile Include="3rd\zxing\common\reedsolomon\ReedSolomonDecoder.cs" /> | |||
<Compile Include="3rd\zxing\common\reedsolomon\ReedSolomonEncoder.cs" /> | |||
<Compile Include="3rd\zxing\common\StringUtils.cs" /> | |||
<Compile Include="3rd\zxing\DecodeHintType.cs" /> | |||
<Compile Include="3rd\zxing\EncodeHintType.cs" /> | |||
<Compile Include="3rd\zxing\LuminanceSource.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\BitMatrixParser.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\DataBlock.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\DataMask.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\DecodedBitStreamParser.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\Decoder.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\ErrorCorrectionLevel.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\FormatInformation.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\Mode.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\QRCodeDecoderMetaData.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\decoder\Version.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\detector\AlignmentPattern.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\detector\AlignmentPatternFinder.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\detector\Detector.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\detector\FinderPattern.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\detector\FinderPatternFinder.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\detector\FinderPatternInfo.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\encoder\BlockPair.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\encoder\ByteMatrix.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\encoder\Encoder.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\encoder\MaskUtil.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\encoder\MatrixUtil.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\encoder\QRCode.cs" /> | |||
<Compile Include="3rd\SimpleJson.cs" /> | |||
<Compile Include="3rd\zxing\qrcode\QRCodeReader.cs" /> | |||
<Compile Include="3rd\zxing\Result.cs" /> | |||
<Compile Include="3rd\zxing\ResultMetadataType.cs" /> | |||
<Compile Include="3rd\zxing\ResultPoint.cs" /> | |||
<Compile Include="3rd\zxing\ResultPointCallback.cs" /> | |||
<Compile Include="3rd\zxing\WriterException.cs" /> | |||
<Compile Include="Controller\AutoStartup.cs" /> | |||
<Compile Include="Controller\FileManager.cs" /> | |||
<Compile Include="Controller\GFWListUpdater.cs" /> | |||
<Compile Include="Controller\I18N.cs" /> | |||
<Compile Include="Controller\Listener.cs" /> | |||
<Compile Include="Controller\Logging.cs" /> | |||
<Compile Include="Controller\PortForwarder.cs" /> | |||
<Compile Include="Controller\UpdateChecker.cs" /> | |||
<Compile Include="Encryption\EncryptorBase.cs" /> | |||
<Compile Include="Encryption\EncryptorFactory.cs" /> | |||
<Compile Include="Encryption\IVEncryptor.cs" /> | |||
<Compile Include="Encryption\PolarSSL.cs" /> | |||
<Compile Include="Encryption\PolarSSLEncryptor.cs" /> | |||
<Compile Include="Encryption\Sodium.cs" /> | |||
<Compile Include="Encryption\SodiumEncryptor.cs" /> | |||
<Compile Include="Encryption\TableEncryptor.cs" /> | |||
<Compile Include="Encryption\IEncryptor.cs" /> | |||
<Compile Include="Controller\PACServer.cs" /> | |||
<Compile Include="Model\Server.cs" /> | |||
<Compile Include="Model\Configuration.cs" /> | |||
<Compile Include="Properties\Resources.Designer.cs"> | |||
<AutoGen>True</AutoGen> | |||
<DesignTime>True</DesignTime> | |||
<DependentUpon>Resources.resx</DependentUpon> | |||
</Compile> | |||
<Compile Include="Util\Util.cs" /> | |||
<Compile Include="View\ConfigForm.cs"> | |||
<SubType>Form</SubType> | |||
</Compile> | |||
<Compile Include="View\ConfigForm.Designer.cs"> | |||
<DependentUpon>ConfigForm.cs</DependentUpon> | |||
</Compile> | |||
<Compile Include="Controller\Local.cs" /> | |||
<Compile Include="Controller\PolipoRunner.cs" /> | |||
<Compile Include="Program.cs" /> | |||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||
<Compile Include="Controller\ShadowsocksController.cs" /> | |||
<Compile Include="Controller\SystemProxy.cs" /> | |||
<Compile Include="View\MenuViewController.cs" /> | |||
<Compile Include="View\QRCodeForm.cs"> | |||
<SubType>Form</SubType> | |||
</Compile> | |||
<Compile Include="View\QRCodeForm.Designer.cs"> | |||
<DependentUpon>QRCodeForm.cs</DependentUpon> | |||
</Compile> | |||
<Compile Include="View\QRCodeSplashForm.cs"> | |||
<SubType>Form</SubType> | |||
</Compile> | |||
<Compile Include="View\ServerLogForm.cs"> | |||
<SubType>Form</SubType> | |||
</Compile> | |||
<Compile Include="View\ServerLogForm.Designer.cs"> | |||
<DependentUpon>ServerLogForm.cs</DependentUpon> | |||
</Compile> | |||
<EmbeddedResource Include="View\ConfigForm.resx"> | |||
<DependentUpon>ConfigForm.cs</DependentUpon> | |||
<SubType>Designer</SubType> | |||
</EmbeddedResource> | |||
<EmbeddedResource Include="Properties\Resources.resx"> | |||
<Generator>ResXFileCodeGenerator</Generator> | |||
<SubType>Designer</SubType> | |||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | |||
</EmbeddedResource> | |||
<EmbeddedResource Include="View\QRCodeForm.resx"> | |||
<DependentUpon>QRCodeForm.cs</DependentUpon> | |||
</EmbeddedResource> | |||
<EmbeddedResource Include="View\ServerLogForm.resx"> | |||
<DependentUpon>ServerLogForm.cs</DependentUpon> | |||
</EmbeddedResource> | |||
<None Include="app.config" /> | |||
<None Include="app.manifest"> | |||
<SubType>Designer</SubType> | |||
</None> | |||
<None Include="Data\abp.js.gz" /> | |||
<None Include="Data\libsscrypto.dll.gz" /> | |||
<None Include="Data\mgwz.dll.gz" /> | |||
<None Include="Data\privoxy.exe.gz" /> | |||
<None Include="Data\proxy.pac.txt.gz" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<None Include="Properties\DataSources\Shadowsocks.View.ConfigForm.datasource" /> | |||
<None Include="Resources\ss20.png" /> | |||
<None Include="Resources\ss16.png" /> | |||
<None Include="Resources\ss24.png" /> | |||
<None Include="Resources\ssw128.png" /> | |||
<Content Include="Data\cn.txt" /> | |||
<None Include="Data\privoxy_conf.txt" /> | |||
<Content Include="Data\user-rule.txt" /> | |||
<Content Include="shadowsocks.ico" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> | |||
<Visible>False</Visible> | |||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> | |||
<Install>false</Install> | |||
</BootstrapperPackage> | |||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> | |||
<Visible>False</Visible> | |||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName> | |||
<Install>false</Install> | |||
</BootstrapperPackage> | |||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> | |||
<Visible>False</Visible> | |||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName> | |||
<Install>false</Install> | |||
</BootstrapperPackage> | |||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> | |||
<Visible>False</Visible> | |||
<ProductName>.NET Framework 3.5</ProductName> | |||
<Install>true</Install> | |||
</BootstrapperPackage> | |||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> | |||
<Visible>False</Visible> | |||
<ProductName>.NET Framework 3.5 SP1</ProductName> | |||
<Install>false</Install> | |||
</BootstrapperPackage> | |||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> | |||
<Visible>False</Visible> | |||
<ProductName>Windows Installer 3.1</ProductName> | |||
<Install>true</Install> | |||
</BootstrapperPackage> | |||
</ItemGroup> | |||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | |||
Other similar extension points exist, see Microsoft.Common.targets. | |||
<Target Name="BeforeBuild"> | |||
</Target> | |||
<Target Name="AfterBuild"> | |||
</Target> | |||
--> | |||
</Project> |