Add server group

pull/2101/head
2dust 2022-03-13 10:41:04 +08:00
parent 887dd8da3b
commit d42346d500
45 changed files with 4843 additions and 3348 deletions

View File

@ -6,7 +6,7 @@ using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer2Form : BaseServerForm
{
{
public AddServer2Form()
{
@ -15,7 +15,7 @@ namespace v2rayN.Forms
private void AddServer2Form_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
if (vmessItem != null)
{
BindingServer();
}
@ -30,7 +30,6 @@ namespace v2rayN.Forms
/// </summary>
private void BindingServer()
{
vmessItem = config.vmess[EditIndex];
txtRemarks.Text = vmessItem.remarks;
txtAddress.Text = vmessItem.address;
txtAddress.ReadOnly = true;
@ -55,7 +54,7 @@ namespace v2rayN.Forms
}
vmessItem.remarks = remarks;
if (ConfigHandler.EditCustomServer(ref config, vmessItem, EditIndex) == 0)
if (ConfigHandler.EditCustomServer(ref config, vmessItem) == 0)
{
this.DialogResult = DialogResult.OK;
}

View File

@ -6,7 +6,7 @@ using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer3Form : BaseServerForm
{
{
public AddServer3Form()
{
@ -16,14 +16,14 @@ namespace v2rayN.Forms
private void AddServer3Form_Load(object sender, EventArgs e)
{
cmbSecurity.Items.AddRange(config.GetShadowsocksSecuritys().ToArray());
if (EditIndex >= 0)
if (vmessItem != null)
{
vmessItem = config.vmess[EditIndex];
BindingServer();
}
else
{
vmessItem = new VmessItem();
vmessItem.groupId = groupId;
ClearServer();
}
}
@ -89,7 +89,7 @@ namespace v2rayN.Forms
vmessItem.security = security;
vmessItem.remarks = remarks;
if (ConfigHandler.AddShadowsocksServer(ref config, vmessItem, EditIndex) == 0)
if (ConfigHandler.AddShadowsocksServer(ref config, vmessItem) == 0)
{
this.DialogResult = DialogResult.OK;
}
@ -101,7 +101,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}
}

View File

@ -6,7 +6,7 @@ using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer4Form : BaseServerForm
{
{
public AddServer4Form()
{
@ -15,14 +15,14 @@ namespace v2rayN.Forms
private void AddServer4Form_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
if (vmessItem != null)
{
vmessItem = config.vmess[EditIndex];
BindingServer();
}
else
{
vmessItem = new VmessItem();
vmessItem.groupId = groupId;
ClearServer();
}
}
@ -77,7 +77,7 @@ namespace v2rayN.Forms
vmessItem.security = security;
vmessItem.remarks = remarks;
if (ConfigHandler.AddSocksServer(ref config, vmessItem, EditIndex) == 0)
if (ConfigHandler.AddSocksServer(ref config, vmessItem) == 0)
{
this.DialogResult = DialogResult.OK;
}
@ -90,7 +90,7 @@ namespace v2rayN.Forms
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View File

@ -17,14 +17,14 @@ namespace v2rayN.Forms
{
cmbFlow.Items.AddRange(Global.xtlsFlows.ToArray());
transportControl.AllowXtls = true;
if (EditIndex >= 0)
if (vmessItem != null)
{
vmessItem = config.vmess[EditIndex];
BindingServer();
}
else
{
vmessItem = new VmessItem();
vmessItem.groupId = groupId;
ClearServer();
}
}
@ -94,7 +94,7 @@ namespace v2rayN.Forms
vmessItem.security = security;
vmessItem.remarks = remarks;
if (ConfigHandler.AddVlessServer(ref config, vmessItem, EditIndex) == 0)
if (ConfigHandler.AddVlessServer(ref config, vmessItem) == 0)
{
this.DialogResult = DialogResult.OK;
}

View File

@ -16,14 +16,14 @@ namespace v2rayN.Forms
{
cmbFlow.Items.AddRange(Global.xtlsFlows.ToArray());
transportControl.AllowXtls = true;
if (EditIndex >= 0)
if (vmessItem != null)
{
vmessItem = config.vmess[EditIndex];
BindingServer();
}
else
{
vmessItem = new VmessItem();
vmessItem.groupId = groupId;
ClearServer();
}
}
@ -52,7 +52,7 @@ namespace v2rayN.Forms
txtPort.Text = "";
txtId.Text = "";
cmbFlow.Text = "";
txtRemarks.Text = "";
txtRemarks.Text = "";
transportControl.ClearServer(vmessItem);
}
@ -89,7 +89,7 @@ namespace v2rayN.Forms
vmessItem.flow = flow;
vmessItem.remarks = remarks;
if (ConfigHandler.AddTrojanServer(ref config, vmessItem, EditIndex) == 0)
if (ConfigHandler.AddTrojanServer(ref config, vmessItem) == 0)
{
this.DialogResult = DialogResult.OK;
}

View File

@ -16,14 +16,14 @@ namespace v2rayN.Forms
private void AddServerForm_Load(object sender, EventArgs e)
{
cmbSecurity.Items.AddRange(Global.vmessSecuritys.ToArray());
if (EditIndex >= 0)
if (vmessItem != null)
{
vmessItem = config.vmess[EditIndex];
BindingServer();
}
else
{
vmessItem = new VmessItem();
vmessItem.groupId = groupId;
ClearServer();
}
}
@ -58,7 +58,7 @@ namespace v2rayN.Forms
transportControl.ClearServer(vmessItem);
}
private void btnOK_Click(object sender, EventArgs e)
{
string address = txtAddress.Text;
@ -93,7 +93,7 @@ namespace v2rayN.Forms
vmessItem.security = security;
vmessItem.remarks = remarks;
if (ConfigHandler.AddServer(ref config, vmessItem, EditIndex) == 0)
if (ConfigHandler.AddServer(ref config, vmessItem) == 0)
{
this.DialogResult = DialogResult.OK;
}

View File

@ -6,8 +6,8 @@ namespace v2rayN.Forms
{
public partial class BaseServerForm : BaseForm
{
public int EditIndex { get; set; }
protected VmessItem vmessItem = null;
public VmessItem vmessItem = null;
public string groupId;
public BaseServerForm()
{

View File

@ -0,0 +1,86 @@
namespace v2rayN.Forms
{
partial class GroupSettingControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GroupSettingControl));
this.grbMain = new System.Windows.Forms.GroupBox();
this.btnRemove = new System.Windows.Forms.Button();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.grbMain.SuspendLayout();
this.SuspendLayout();
//
// grbMain
//
resources.ApplyResources(this.grbMain, "grbMain");
this.grbMain.Controls.Add(this.btnRemove);
this.grbMain.Controls.Add(this.txtRemarks);
this.grbMain.Controls.Add(this.label2);
this.grbMain.Name = "grbMain";
this.grbMain.TabStop = false;
//
// btnRemove
//
resources.ApplyResources(this.btnRemove, "btnRemove");
this.btnRemove.Name = "btnRemove";
this.btnRemove.UseVisualStyleBackColor = true;
this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
this.txtRemarks.Leave += new System.EventHandler(this.txtRemarks_Leave);
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// GroupSettingControl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.grbMain);
this.Name = "GroupSettingControl";
this.Load += new System.EventHandler(this.GroupSettingControl_Load);
this.grbMain.ResumeLayout(false);
this.grbMain.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox grbMain;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnRemove;
}
}

View File

@ -0,0 +1,59 @@
using System;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class GroupSettingControl : UserControl
{
public event ChangeEventHandler OnButtonClicked;
public GroupItem groupItem
{
get; set;
}
public GroupSettingControl()
{
InitializeComponent();
}
private void GroupSettingControl_Load(object sender, EventArgs e)
{
this.Height = grbMain.Height;
BindingSub();
}
private void BindingSub()
{
if (groupItem != null)
{
txtRemarks.Text = groupItem.remarks.ToString();
}
}
private void EndBindingSub()
{
if (groupItem != null)
{
groupItem.remarks = txtRemarks.Text.TrimEx();
}
}
private void txtRemarks_Leave(object sender, EventArgs e)
{
EndBindingSub();
}
private void btnRemove_Click(object sender, EventArgs e)
{
if (groupItem != null)
{
groupItem.remarks = string.Empty;
}
OnButtonClicked?.Invoke(sender, e);
}
}
}

View File

@ -0,0 +1,243 @@
<?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>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="grbMain.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>292, 21</value>
</data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>525, 21</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 21</value>
</data>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
</data>
<data name="btnRemove.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>GroupSettingControl</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;btnRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;grbMain.Name" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="grbMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="grbMain.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 61</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="grbMain.Text" xml:space="preserve">
<value>Group details</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>btnRemove</value>
</data>
<data name="grbMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;grbMain.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;grbMain.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 61</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>Remove</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,133 @@
<?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>
<data name="btnRemove.Text" xml:space="preserve">
<value>移除</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>备注</value>
</data>
<data name="grbMain.Text" xml:space="preserve">
<value>分组详情</value>
</data>
</root>

View File

@ -0,0 +1,97 @@
namespace v2rayN.Forms
{
partial class GroupSettingForm
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GroupSettingForm));
this.btnClose = new System.Windows.Forms.Button();
this.panCon = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.btnAdd = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// panCon
//
resources.ApplyResources(this.panCon, "panCon");
this.panCon.Name = "panCon";
//
// panel2
//
this.panel2.Controls.Add(this.btnAdd);
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnAdd
//
resources.ApplyResources(this.btnAdd, "btnAdd");
this.btnAdd.Name = "btnAdd";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// GroupSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panCon);
this.Controls.Add(this.panel2);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "GroupSettingForm";
this.Load += new System.EventHandler(this.GroupSettingForm_Load);
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Panel panCon;
}
}

View File

@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class GroupSettingForm : BaseForm
{
List<GroupSettingControl> lstControls = new List<GroupSettingControl>();
public GroupSettingForm()
{
InitializeComponent();
}
private void GroupSettingForm_Load(object sender, EventArgs e)
{
if (config.groupItem == null)
{
config.groupItem = new List<GroupItem>();
}
RefreshGroupsView();
}
/// <summary>
/// 刷新列表
/// </summary>
private void RefreshGroupsView()
{
panCon.Controls.Clear();
lstControls.Clear();
for (int k = config.groupItem.Count - 1; k >= 0; k--)
{
GroupItem item = config.groupItem[k];
if (Utils.IsNullOrEmpty(item.remarks))
{
if (!Utils.IsNullOrEmpty(item.id))
{
ConfigHandler.RemoveGroupItem(ref config, item.id);
}
config.groupItem.RemoveAt(k);
}
}
foreach (GroupItem item in config.groupItem)
{
GroupSettingControl control = new GroupSettingControl();
control.OnButtonClicked += Control_OnButtonClicked;
control.groupItem = item;
control.Dock = DockStyle.Top;
panCon.Controls.Add(control);
panCon.Controls.SetChildIndex(control, 0);
lstControls.Add(control);
}
}
private void Control_OnButtonClicked(object sender, EventArgs e)
{
RefreshGroupsView();
}
private void btnOK_Click(object sender, EventArgs e)
{
if (config.groupItem.Count <= 0)
{
AddGroup();
}
if (ConfigHandler.SaveGroupItem(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void btnAdd_Click(object sender, EventArgs e)
{
AddGroup();
RefreshGroupsView();
}
private void AddGroup()
{
GroupItem groupItem = new GroupItem
{
id = string.Empty,
remarks = "remarks"
};
config.groupItem.Add(groupItem);
}
}
}

View File

@ -0,0 +1,273 @@
<?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>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>448, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="panCon.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panCon.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>614, 351</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;panCon.Name" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;panCon.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panCon.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panCon.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnAdd.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnAdd.Location" type="System.Drawing.Point, System.Drawing">
<value>47, 17</value>
</data>
<data name="btnAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnAdd.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="btnAdd.Text" xml:space="preserve">
<value>&amp;Add</value>
</data>
<data name="&gt;&gt;btnAdd.Name" xml:space="preserve">
<value>btnAdd</value>
</data>
<data name="&gt;&gt;btnAdd.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnAdd.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnAdd.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>355, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 351</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>614, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>614, 411</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Group settings</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>GroupSettingForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -0,0 +1,132 @@
<?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>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnAdd.Text" xml:space="preserve">
<value>添加(&amp;A)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>服务器分组设置</value>
</data>
</root>

View File

@ -65,6 +65,7 @@
this.menuExport2ShareUrl = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2SubContent = new System.Windows.Forms.ToolStripMenuItem();
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
this.tabGroup = new System.Windows.Forms.TabControl();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.groupBox1 = new System.Windows.Forms.GroupBox();
@ -114,6 +115,7 @@
this.tsbOptionSetting = new System.Windows.Forms.ToolStripMenuItem();
this.tsbRoutingSetting = new System.Windows.Forms.ToolStripMenuItem();
this.tsbGlobalHotkeySetting = new System.Windows.Forms.ToolStripMenuItem();
this.tsbGroupSetting = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
this.tsbBackupGuiNConfig = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
@ -161,19 +163,18 @@
//
// scMain.Panel1
//
resources.ApplyResources(this.scMain.Panel1, "scMain.Panel1");
this.scMain.Panel1.Controls.Add(this.lvServers);
this.scMain.Panel1.Controls.Add(this.tabGroup);
//
// scMain.Panel2
//
resources.ApplyResources(this.scMain.Panel2, "scMain.Panel2");
this.scMain.Panel2.Controls.Add(this.qrCodeControl);
this.scMain.TabStop = false;
//
// lvServers
//
resources.ApplyResources(this.lvServers, "lvServers");
this.lvServers.ContextMenuStrip = this.cmsLv;
resources.ApplyResources(this.lvServers, "lvServers");
this.lvServers.FullRowSelect = true;
this.lvServers.GridLines = true;
this.lvServers.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
@ -192,7 +193,6 @@
//
// cmsLv
//
resources.ApplyResources(this.cmsLv, "cmsLv");
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAddVmessServer,
@ -227,196 +227,205 @@
this.menuExport2ShareUrl,
this.menuExport2SubContent});
this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.tsbServer;
resources.ApplyResources(this.cmsLv, "cmsLv");
//
// menuAddVmessServer
//
resources.ApplyResources(this.menuAddVmessServer, "menuAddVmessServer");
this.menuAddVmessServer.Name = "menuAddVmessServer";
resources.ApplyResources(this.menuAddVmessServer, "menuAddVmessServer");
this.menuAddVmessServer.Click += new System.EventHandler(this.menuAddVmessServer_Click);
//
// menuAddVlessServer
//
resources.ApplyResources(this.menuAddVlessServer, "menuAddVlessServer");
this.menuAddVlessServer.Name = "menuAddVlessServer";
resources.ApplyResources(this.menuAddVlessServer, "menuAddVlessServer");
this.menuAddVlessServer.Click += new System.EventHandler(this.menuAddVlessServer_Click);
//
// menuAddShadowsocksServer
//
resources.ApplyResources(this.menuAddShadowsocksServer, "menuAddShadowsocksServer");
this.menuAddShadowsocksServer.Name = "menuAddShadowsocksServer";
resources.ApplyResources(this.menuAddShadowsocksServer, "menuAddShadowsocksServer");
this.menuAddShadowsocksServer.Click += new System.EventHandler(this.menuAddShadowsocksServer_Click);
//
// menuAddSocksServer
//
resources.ApplyResources(this.menuAddSocksServer, "menuAddSocksServer");
this.menuAddSocksServer.Name = "menuAddSocksServer";
resources.ApplyResources(this.menuAddSocksServer, "menuAddSocksServer");
this.menuAddSocksServer.Click += new System.EventHandler(this.menuAddSocksServer_Click);
//
// menuAddTrojanServer
//
resources.ApplyResources(this.menuAddTrojanServer, "menuAddTrojanServer");
this.menuAddTrojanServer.Name = "menuAddTrojanServer";
resources.ApplyResources(this.menuAddTrojanServer, "menuAddTrojanServer");
this.menuAddTrojanServer.Click += new System.EventHandler(this.menuAddTrojanServer_Click);
//
// menuAddCustomServer
//
resources.ApplyResources(this.menuAddCustomServer, "menuAddCustomServer");
this.menuAddCustomServer.Name = "menuAddCustomServer";
resources.ApplyResources(this.menuAddCustomServer, "menuAddCustomServer");
this.menuAddCustomServer.Click += new System.EventHandler(this.menuAddCustomServer_Click);
//
// menuAddServers
//
resources.ApplyResources(this.menuAddServers, "menuAddServers");
this.menuAddServers.Name = "menuAddServers";
resources.ApplyResources(this.menuAddServers, "menuAddServers");
this.menuAddServers.Click += new System.EventHandler(this.menuAddServers_Click);
//
// menuScanScreen
//
resources.ApplyResources(this.menuScanScreen, "menuScanScreen");
this.menuScanScreen.Name = "menuScanScreen";
resources.ApplyResources(this.menuScanScreen, "menuScanScreen");
this.menuScanScreen.Click += new System.EventHandler(this.menuScanScreen_Click);
//
// toolStripSeparator1
//
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// menuRemoveServer
//
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
this.menuRemoveServer.Name = "menuRemoveServer";
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
this.menuRemoveServer.Click += new System.EventHandler(this.menuRemoveServer_Click);
//
// menuRemoveDuplicateServer
//
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
this.menuRemoveDuplicateServer.Name = "menuRemoveDuplicateServer";
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
this.menuRemoveDuplicateServer.Click += new System.EventHandler(this.menuRemoveDuplicateServer_Click);
//
// menuCopyServer
//
resources.ApplyResources(this.menuCopyServer, "menuCopyServer");
this.menuCopyServer.Name = "menuCopyServer";
resources.ApplyResources(this.menuCopyServer, "menuCopyServer");
this.menuCopyServer.Click += new System.EventHandler(this.menuCopyServer_Click);
//
// menuSetDefaultServer
//
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
this.menuSetDefaultServer.Name = "menuSetDefaultServer";
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
this.menuSetDefaultServer.Click += new System.EventHandler(this.menuSetDefaultServer_Click);
//
// toolStripSeparator3
//
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
this.toolStripSeparator3.Name = "toolStripSeparator3";
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
//
// menuMoveTop
//
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Name = "menuMoveTop";
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
//
// menuMoveUp
//
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Name = "menuMoveUp";
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
//
// menuMoveDown
//
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Name = "menuMoveDown";
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
//
// menuMoveBottom
//
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Name = "menuMoveBottom";
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
//
// menuSelectAll
//
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Name = "menuSelectAll";
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
//
// toolStripSeparator9
//
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
this.toolStripSeparator9.Name = "toolStripSeparator9";
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
//
// menuPingServer
//
resources.ApplyResources(this.menuPingServer, "menuPingServer");
this.menuPingServer.Name = "menuPingServer";
resources.ApplyResources(this.menuPingServer, "menuPingServer");
this.menuPingServer.Click += new System.EventHandler(this.menuPingServer_Click);
//
// menuTcpingServer
//
resources.ApplyResources(this.menuTcpingServer, "menuTcpingServer");
this.menuTcpingServer.Name = "menuTcpingServer";
resources.ApplyResources(this.menuTcpingServer, "menuTcpingServer");
this.menuTcpingServer.Click += new System.EventHandler(this.menuTcpingServer_Click);
//
// menuRealPingServer
//
resources.ApplyResources(this.menuRealPingServer, "menuRealPingServer");
this.menuRealPingServer.Name = "menuRealPingServer";
resources.ApplyResources(this.menuRealPingServer, "menuRealPingServer");
this.menuRealPingServer.Click += new System.EventHandler(this.menuRealPingServer_Click);
//
// menuSpeedServer
//
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
this.menuSpeedServer.Name = "menuSpeedServer";
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click);
//
// tsbTestMe
//
resources.ApplyResources(this.tsbTestMe, "tsbTestMe");
this.tsbTestMe.Name = "tsbTestMe";
resources.ApplyResources(this.tsbTestMe, "tsbTestMe");
this.tsbTestMe.Click += new System.EventHandler(this.tsbTestMe_Click);
//
// menuClearServerStatistics
//
resources.ApplyResources(this.menuClearServerStatistics, "menuClearServerStatistics");
this.menuClearServerStatistics.Name = "menuClearServerStatistics";
resources.ApplyResources(this.menuClearServerStatistics, "menuClearServerStatistics");
this.menuClearServerStatistics.Click += new System.EventHandler(this.menuClearStatistic_Click);
//
// toolStripSeparator6
//
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
this.toolStripSeparator6.Name = "toolStripSeparator6";
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
//
// menuExport2ClientConfig
//
resources.ApplyResources(this.menuExport2ClientConfig, "menuExport2ClientConfig");
this.menuExport2ClientConfig.Name = "menuExport2ClientConfig";
resources.ApplyResources(this.menuExport2ClientConfig, "menuExport2ClientConfig");
this.menuExport2ClientConfig.Click += new System.EventHandler(this.menuExport2ClientConfig_Click);
//
// menuExport2ServerConfig
//
resources.ApplyResources(this.menuExport2ServerConfig, "menuExport2ServerConfig");
this.menuExport2ServerConfig.Name = "menuExport2ServerConfig";
resources.ApplyResources(this.menuExport2ServerConfig, "menuExport2ServerConfig");
this.menuExport2ServerConfig.Click += new System.EventHandler(this.menuExport2ServerConfig_Click);
//
// menuExport2ShareUrl
//
resources.ApplyResources(this.menuExport2ShareUrl, "menuExport2ShareUrl");
this.menuExport2ShareUrl.Name = "menuExport2ShareUrl";
resources.ApplyResources(this.menuExport2ShareUrl, "menuExport2ShareUrl");
this.menuExport2ShareUrl.Click += new System.EventHandler(this.menuExport2ShareUrl_Click);
//
// menuExport2SubContent
//
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Name = "menuExport2SubContent";
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
//
// tsbServer
//
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.DropDown = this.cmsLv;
this.tsbServer.Image = global::v2rayN.Properties.Resources.server;
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.Name = "tsbServer";
//
// tabGroup
//
resources.ApplyResources(this.tabGroup, "tabGroup");
this.tabGroup.Name = "tabGroup";
this.tabGroup.SelectedIndex = 0;
this.tabGroup.SelectedIndexChanged += new System.EventHandler(this.tabGroup_SelectedIndexChanged);
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
@ -429,35 +438,33 @@
//
// splitContainer1.Panel1
//
resources.ApplyResources(this.splitContainer1.Panel1, "splitContainer1.Panel1");
this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
//
// splitContainer1.Panel2
//
resources.ApplyResources(this.splitContainer1.Panel2, "splitContainer1.Panel2");
this.splitContainer1.Panel2.Controls.Add(this.gbMsgTitle);
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.scMain);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// gbMsgTitle
//
resources.ApplyResources(this.gbMsgTitle, "gbMsgTitle");
this.gbMsgTitle.Controls.Add(this.txtMsgBox);
this.gbMsgTitle.Controls.Add(this.ssMain);
resources.ApplyResources(this.gbMsgTitle, "gbMsgTitle");
this.gbMsgTitle.Name = "gbMsgTitle";
this.gbMsgTitle.TabStop = false;
//
// txtMsgBox
//
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
@ -465,7 +472,6 @@
//
// cmsMsgBox
//
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMsgBoxSelectAll,
this.menuMsgBoxCopy,
@ -474,46 +480,46 @@
this.menuMsgBoxAddRoutingRule,
this.menuMsgBoxFilter});
this.cmsMsgBox.Name = "cmsMsgBox";
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
//
// menuMsgBoxSelectAll
//
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
//
// menuMsgBoxCopy
//
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
//
// menuMsgBoxCopyAll
//
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
//
// menuMsgBoxClear
//
resources.ApplyResources(this.menuMsgBoxClear, "menuMsgBoxClear");
this.menuMsgBoxClear.Name = "menuMsgBoxClear";
resources.ApplyResources(this.menuMsgBoxClear, "menuMsgBoxClear");
this.menuMsgBoxClear.Click += new System.EventHandler(this.menuMsgBoxClear_Click);
//
// menuMsgBoxAddRoutingRule
//
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
//
// menuMsgBoxFilter
//
resources.ApplyResources(this.menuMsgBoxFilter, "menuMsgBoxFilter");
this.menuMsgBoxFilter.Name = "menuMsgBoxFilter";
resources.ApplyResources(this.menuMsgBoxFilter, "menuMsgBoxFilter");
this.menuMsgBoxFilter.Click += new System.EventHandler(this.menuMsgBoxFilter_Click);
//
// ssMain
//
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslInboundInfo,
@ -522,13 +528,14 @@
this.toolSslBlank2,
this.toolSslServerSpeed,
this.toolSslBlank4});
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
// toolSslInboundInfo
//
resources.ApplyResources(this.toolSslInboundInfo, "toolSslInboundInfo");
this.toolSslInboundInfo.Name = "toolSslInboundInfo";
resources.ApplyResources(this.toolSslInboundInfo, "toolSslInboundInfo");
//
// toolSslBlank1
//
@ -538,13 +545,13 @@
//
// toolSslRoutingRule
//
resources.ApplyResources(this.toolSslRoutingRule, "toolSslRoutingRule");
this.toolSslRoutingRule.Name = "toolSslRoutingRule";
resources.ApplyResources(this.toolSslRoutingRule, "toolSslRoutingRule");
//
// toolSslBlank2
//
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Name = "toolSslBlank2";
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Spring = true;
//
// toolSslServerSpeed
@ -555,19 +562,19 @@
//
// toolSslBlank4
//
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
this.toolSslBlank4.Name = "toolSslBlank4";
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
//
// notifyMain
//
resources.ApplyResources(this.notifyMain, "notifyMain");
this.notifyMain.ContextMenuStrip = this.cmsMain;
resources.ApplyResources(this.notifyMain, "notifyMain");
this.notifyMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyMain_MouseClick);
//
// cmsMain
//
resources.ApplyResources(this.cmsMain, "cmsMain");
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
resources.ApplyResources(this.cmsMain, "cmsMain");
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuSysAgentMode,
this.menuRoutings,
@ -587,87 +594,87 @@
//
// menuSysAgentMode
//
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuKeepClear,
this.menuGlobal,
this.menuKeepNothing});
this.menuSysAgentMode.Name = "menuSysAgentMode";
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
//
// menuKeepClear
//
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
this.menuKeepClear.Name = "menuKeepClear";
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
this.menuKeepClear.Click += new System.EventHandler(this.menuKeepClear_Click);
//
// menuGlobal
//
resources.ApplyResources(this.menuGlobal, "menuGlobal");
this.menuGlobal.Name = "menuGlobal";
resources.ApplyResources(this.menuGlobal, "menuGlobal");
this.menuGlobal.Click += new System.EventHandler(this.menuGlobal_Click);
//
// menuKeepNothing
//
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
this.menuKeepNothing.Name = "menuKeepNothing";
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
this.menuKeepNothing.Click += new System.EventHandler(this.menuKeepNothing_Click);
//
// menuRoutings
//
resources.ApplyResources(this.menuRoutings, "menuRoutings");
this.menuRoutings.Name = "menuRoutings";
resources.ApplyResources(this.menuRoutings, "menuRoutings");
//
// menuServers
//
resources.ApplyResources(this.menuServers, "menuServers");
this.menuServers.Name = "menuServers";
resources.ApplyResources(this.menuServers, "menuServers");
//
// menuServers2
//
resources.ApplyResources(this.menuServers2, "menuServers2");
this.menuServers2.BackColor = System.Drawing.SystemColors.Window;
this.menuServers2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.menuServers2.DropDownWidth = 500;
resources.ApplyResources(this.menuServers2, "menuServers2");
this.menuServers2.Name = "menuServers2";
//
// toolStripSeparator13
//
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
this.toolStripSeparator13.Name = "toolStripSeparator13";
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
//
// menuAddServers2
//
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
this.menuAddServers2.Name = "menuAddServers2";
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
this.menuAddServers2.Click += new System.EventHandler(this.menuAddServers_Click);
//
// menuScanScreen2
//
resources.ApplyResources(this.menuScanScreen2, "menuScanScreen2");
this.menuScanScreen2.Name = "menuScanScreen2";
resources.ApplyResources(this.menuScanScreen2, "menuScanScreen2");
this.menuScanScreen2.Click += new System.EventHandler(this.menuScanScreen_Click);
//
// menuUpdateSubscriptions
//
resources.ApplyResources(this.menuUpdateSubscriptions, "menuUpdateSubscriptions");
this.menuUpdateSubscriptions.Name = "menuUpdateSubscriptions";
resources.ApplyResources(this.menuUpdateSubscriptions, "menuUpdateSubscriptions");
this.menuUpdateSubscriptions.Click += new System.EventHandler(this.menuUpdateSubscriptions_Click);
//
// menuUpdateSubViaProxy
//
resources.ApplyResources(this.menuUpdateSubViaProxy, "menuUpdateSubViaProxy");
this.menuUpdateSubViaProxy.Name = "menuUpdateSubViaProxy";
resources.ApplyResources(this.menuUpdateSubViaProxy, "menuUpdateSubViaProxy");
this.menuUpdateSubViaProxy.Click += new System.EventHandler(this.menuUpdateSubViaProxy_Click);
//
// toolStripSeparator2
//
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
this.toolStripSeparator2.Name = "toolStripSeparator2";
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
//
// menuExit
//
resources.ApplyResources(this.menuExit, "menuExit");
this.menuExit.Name = "menuExit";
resources.ApplyResources(this.menuExit, "menuExit");
this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
//
// bgwScan
@ -683,7 +690,6 @@
//
// tsMain
//
resources.ApplyResources(this.tsMain, "tsMain");
this.tsMain.ImageScalingSize = new System.Drawing.Size(32, 32);
this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbServer,
@ -701,116 +707,124 @@
this.tsbPromotion,
this.toolStripSeparator11,
this.tsbClose});
resources.ApplyResources(this.tsMain, "tsMain");
this.tsMain.Name = "tsMain";
this.tsMain.TabStop = true;
//
// toolStripSeparator4
//
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
this.toolStripSeparator4.Name = "toolStripSeparator4";
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
//
// tsbSub
//
resources.ApplyResources(this.tsbSub, "tsbSub");
this.tsbSub.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbSubSetting,
this.tsbSubUpdate,
this.tsbSubUpdateViaProxy});
this.tsbSub.Image = global::v2rayN.Properties.Resources.sub;
resources.ApplyResources(this.tsbSub, "tsbSub");
this.tsbSub.Name = "tsbSub";
//
// tsbSubSetting
//
resources.ApplyResources(this.tsbSubSetting, "tsbSubSetting");
this.tsbSubSetting.Name = "tsbSubSetting";
resources.ApplyResources(this.tsbSubSetting, "tsbSubSetting");
this.tsbSubSetting.Click += new System.EventHandler(this.tsbSubSetting_Click);
//
// tsbSubUpdate
//
resources.ApplyResources(this.tsbSubUpdate, "tsbSubUpdate");
this.tsbSubUpdate.Name = "tsbSubUpdate";
resources.ApplyResources(this.tsbSubUpdate, "tsbSubUpdate");
this.tsbSubUpdate.Click += new System.EventHandler(this.tsbSubUpdate_Click);
//
// tsbSubUpdateViaProxy
//
resources.ApplyResources(this.tsbSubUpdateViaProxy, "tsbSubUpdateViaProxy");
this.tsbSubUpdateViaProxy.Name = "tsbSubUpdateViaProxy";
resources.ApplyResources(this.tsbSubUpdateViaProxy, "tsbSubUpdateViaProxy");
this.tsbSubUpdateViaProxy.Click += new System.EventHandler(this.tsbSubUpdateViaProxy_Click);
//
// tsbQRCodeSwitch
//
resources.ApplyResources(this.tsbQRCodeSwitch, "tsbQRCodeSwitch");
this.tsbQRCodeSwitch.CheckOnClick = true;
this.tsbQRCodeSwitch.ForeColor = System.Drawing.Color.Black;
this.tsbQRCodeSwitch.Image = global::v2rayN.Properties.Resources.share;
resources.ApplyResources(this.tsbQRCodeSwitch, "tsbQRCodeSwitch");
this.tsbQRCodeSwitch.Name = "tsbQRCodeSwitch";
this.tsbQRCodeSwitch.CheckedChanged += new System.EventHandler(this.tsbQRCodeSwitch_CheckedChanged);
//
// toolStripSeparator8
//
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
this.toolStripSeparator8.Name = "toolStripSeparator8";
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
//
// tsbSetting
//
resources.ApplyResources(this.tsbSetting, "tsbSetting");
this.tsbSetting.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbOptionSetting,
this.tsbRoutingSetting,
this.tsbGlobalHotkeySetting,
this.tsbGroupSetting,
this.toolStripSeparator14,
this.tsbBackupGuiNConfig});
this.tsbSetting.Image = global::v2rayN.Properties.Resources.option;
resources.ApplyResources(this.tsbSetting, "tsbSetting");
this.tsbSetting.Name = "tsbSetting";
//
// tsbOptionSetting
//
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
this.tsbOptionSetting.Name = "tsbOptionSetting";
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
this.tsbOptionSetting.Click += new System.EventHandler(this.tsbOptionSetting_Click);
//
// tsbRoutingSetting
//
resources.ApplyResources(this.tsbRoutingSetting, "tsbRoutingSetting");
this.tsbRoutingSetting.Name = "tsbRoutingSetting";
resources.ApplyResources(this.tsbRoutingSetting, "tsbRoutingSetting");
this.tsbRoutingSetting.Click += new System.EventHandler(this.tsbRoutingSetting_Click);
//
// tsbGlobalHotkeySetting
//
resources.ApplyResources(this.tsbGlobalHotkeySetting, "tsbGlobalHotkeySetting");
this.tsbGlobalHotkeySetting.Name = "tsbGlobalHotkeySetting";
resources.ApplyResources(this.tsbGlobalHotkeySetting, "tsbGlobalHotkeySetting");
this.tsbGlobalHotkeySetting.Click += new System.EventHandler(this.tsbGlobalHotkeySetting_Click);
//
// tsbGroupSetting
//
this.tsbGroupSetting.Name = "tsbGroupSetting";
resources.ApplyResources(this.tsbGroupSetting, "tsbGroupSetting");
this.tsbGroupSetting.Click += new System.EventHandler(this.tsbGroupSetting_Click);
//
// toolStripSeparator14
//
resources.ApplyResources(this.toolStripSeparator14, "toolStripSeparator14");
this.toolStripSeparator14.Name = "toolStripSeparator14";
resources.ApplyResources(this.toolStripSeparator14, "toolStripSeparator14");
//
// tsbBackupGuiNConfig
//
resources.ApplyResources(this.tsbBackupGuiNConfig, "tsbBackupGuiNConfig");
this.tsbBackupGuiNConfig.Name = "tsbBackupGuiNConfig";
resources.ApplyResources(this.tsbBackupGuiNConfig, "tsbBackupGuiNConfig");
this.tsbBackupGuiNConfig.Click += new System.EventHandler(this.tsbBackupGuiNConfig_Click);
//
// toolStripSeparator5
//
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
this.toolStripSeparator5.Name = "toolStripSeparator5";
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
//
// tsbReload
//
this.tsbReload.Image = global::v2rayN.Properties.Resources.restart;
resources.ApplyResources(this.tsbReload, "tsbReload");
this.tsbReload.Name = "tsbReload";
this.tsbReload.Click += new System.EventHandler(this.tsbReload_Click);
//
// toolStripSeparator7
//
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
this.toolStripSeparator7.Name = "toolStripSeparator7";
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
//
// tsbCheckUpdate
//
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbCheckUpdateN,
this.tsbCheckUpdateCore,
@ -819,51 +833,51 @@
this.tsbCheckUpdateGeoSite,
this.tsbCheckUpdateGeoIP});
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
this.tsbCheckUpdate.Name = "tsbCheckUpdate";
//
// tsbCheckUpdateN
//
resources.ApplyResources(this.tsbCheckUpdateN, "tsbCheckUpdateN");
this.tsbCheckUpdateN.Name = "tsbCheckUpdateN";
resources.ApplyResources(this.tsbCheckUpdateN, "tsbCheckUpdateN");
this.tsbCheckUpdateN.Click += new System.EventHandler(this.tsbCheckUpdateN_Click);
//
// tsbCheckUpdateCore
//
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
this.tsbCheckUpdateCore.Name = "tsbCheckUpdateCore";
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click);
//
// tsbCheckUpdateXrayCore
//
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
this.tsbCheckUpdateXrayCore.Name = "tsbCheckUpdateXrayCore";
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
this.tsbCheckUpdateXrayCore.Click += new System.EventHandler(this.tsbCheckUpdateXrayCore_Click);
//
// toolStripSeparator15
//
resources.ApplyResources(this.toolStripSeparator15, "toolStripSeparator15");
this.toolStripSeparator15.Name = "toolStripSeparator15";
resources.ApplyResources(this.toolStripSeparator15, "toolStripSeparator15");
//
// tsbCheckUpdateGeoSite
//
resources.ApplyResources(this.tsbCheckUpdateGeoSite, "tsbCheckUpdateGeoSite");
this.tsbCheckUpdateGeoSite.Name = "tsbCheckUpdateGeoSite";
resources.ApplyResources(this.tsbCheckUpdateGeoSite, "tsbCheckUpdateGeoSite");
this.tsbCheckUpdateGeoSite.Click += new System.EventHandler(this.tsbCheckUpdateGeoSite_Click);
//
// tsbCheckUpdateGeoIP
//
resources.ApplyResources(this.tsbCheckUpdateGeoIP, "tsbCheckUpdateGeoIP");
this.tsbCheckUpdateGeoIP.Name = "tsbCheckUpdateGeoIP";
resources.ApplyResources(this.tsbCheckUpdateGeoIP, "tsbCheckUpdateGeoIP");
this.tsbCheckUpdateGeoIP.Click += new System.EventHandler(this.tsbCheckUpdateGeoIP_Click);
//
// toolStripSeparator10
//
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
this.toolStripSeparator10.Name = "toolStripSeparator10";
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
//
// tsbHelp
//
resources.ApplyResources(this.tsbHelp, "tsbHelp");
this.tsbHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbAbout,
this.tsbV2rayWebsite,
@ -871,52 +885,54 @@
this.tsbLanguageDef,
this.tsbLanguageZhHans});
this.tsbHelp.Image = global::v2rayN.Properties.Resources.help;
resources.ApplyResources(this.tsbHelp, "tsbHelp");
this.tsbHelp.Name = "tsbHelp";
//
// tsbAbout
//
resources.ApplyResources(this.tsbAbout, "tsbAbout");
this.tsbAbout.Name = "tsbAbout";
resources.ApplyResources(this.tsbAbout, "tsbAbout");
this.tsbAbout.Click += new System.EventHandler(this.tsbAbout_Click);
//
// tsbV2rayWebsite
//
resources.ApplyResources(this.tsbV2rayWebsite, "tsbV2rayWebsite");
this.tsbV2rayWebsite.Name = "tsbV2rayWebsite";
resources.ApplyResources(this.tsbV2rayWebsite, "tsbV2rayWebsite");
this.tsbV2rayWebsite.Click += new System.EventHandler(this.tsbV2rayWebsite_Click);
//
// toolStripSeparator12
//
resources.ApplyResources(this.toolStripSeparator12, "toolStripSeparator12");
this.toolStripSeparator12.Name = "toolStripSeparator12";
resources.ApplyResources(this.toolStripSeparator12, "toolStripSeparator12");
//
// tsbLanguageDef
//
resources.ApplyResources(this.tsbLanguageDef, "tsbLanguageDef");
this.tsbLanguageDef.Name = "tsbLanguageDef";
resources.ApplyResources(this.tsbLanguageDef, "tsbLanguageDef");
this.tsbLanguageDef.Click += new System.EventHandler(this.tsbLanguageDef_Click);
//
// tsbLanguageZhHans
//
resources.ApplyResources(this.tsbLanguageZhHans, "tsbLanguageZhHans");
this.tsbLanguageZhHans.Name = "tsbLanguageZhHans";
resources.ApplyResources(this.tsbLanguageZhHans, "tsbLanguageZhHans");
this.tsbLanguageZhHans.Click += new System.EventHandler(this.tsbLanguageZhHans_Click);
//
// tsbPromotion
//
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
this.tsbPromotion.ForeColor = System.Drawing.Color.Black;
this.tsbPromotion.Image = global::v2rayN.Properties.Resources.promotion;
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
this.tsbPromotion.Name = "tsbPromotion";
this.tsbPromotion.Click += new System.EventHandler(this.tsbPromotion_Click);
//
// toolStripSeparator11
//
resources.ApplyResources(this.toolStripSeparator11, "toolStripSeparator11");
this.toolStripSeparator11.Name = "toolStripSeparator11";
resources.ApplyResources(this.toolStripSeparator11, "toolStripSeparator11");
//
// tsbClose
//
this.tsbClose.Image = global::v2rayN.Properties.Resources.minimize;
resources.ApplyResources(this.tsbClose, "tsbClose");
this.tsbClose.Name = "tsbClose";
this.tsbClose.Click += new System.EventHandler(this.tsbClose_Click);
@ -1067,6 +1083,8 @@
private System.Windows.Forms.ToolStripMenuItem menuUpdateSubViaProxy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxClear;
private System.Windows.Forms.ToolStripMenuItem tsbGlobalHotkeySetting;
private System.Windows.Forms.TabControl tabGroup;
private System.Windows.Forms.ToolStripMenuItem tsbGroupSetting;
}
}

View File

@ -11,15 +11,18 @@ using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Tool;
using System.Linq;
namespace v2rayN.Forms
{
public partial class MainForm : BaseForm
{
private V2rayHandler v2rayHandler;
private List<int> lvSelecteds = new List<int>();
private List<VmessItem> lvSelecteds = new List<VmessItem>();
private StatisticsHandler statistics = null;
private string MsgFilter = string.Empty;
private List<VmessItem> lstVmess = null;
private string groupId = string.Empty;
#region Window 事件
@ -46,6 +49,7 @@ namespace v2rayN.Forms
Environment.Exit(0);
return;
}
ConfigHandler.InitBuiltinRouting(ref config);
MainFormHandler.Instance.BackupGuiNConfig(config, true);
v2rayHandler = new V2rayHandler();
@ -72,6 +76,7 @@ namespace v2rayN.Forms
private void MainForm_Shown(object sender, EventArgs e)
{
InitGroupView();
InitServersView();
RefreshServers();
RefreshRoutingsMenu();
@ -196,8 +201,10 @@ namespace v2rayN.Forms
/// </summary>
private void RefreshServers()
{
lstVmess = config.vmess.Where(it => it.groupId == groupId).OrderBy(it => it.sort).ToList();
ConfigHandler.SetDefaultServer(config, lstVmess);
RefreshServersView();
//lvServers.AutoResizeColumns();
RefreshServersMenu();
}
@ -247,24 +254,24 @@ namespace v2rayN.Forms
lvServers.BeginUpdate();
lvServers.Items.Clear();
for (int k = 0; k < config.vmess.Count; k++)
for (int k = 0; k < lstVmess.Count; k++)
{
string def = string.Empty;
string totalUp = string.Empty,
totalDown = string.Empty,
todayUp = string.Empty,
todayDown = string.Empty;
if (config.index.Equals(k))
VmessItem item = lstVmess[k];
if (config.IsActiveNode(item))
{
def = "√";
}
VmessItem item = config.vmess[k];
bool stats = statistics != null && statistics.Enable;
if (stats)
{
ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId());
ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.indexId);
if (sItem != null)
{
totalUp = Utils.HumanFy(sItem.totalUp);
@ -295,7 +302,7 @@ namespace v2rayN.Forms
{
lvItem.BackColor = Color.WhiteSmoke;
}
if (config.index.Equals(k))
if (config.IsActiveNode(item))
{
//lvItem.Checked = true;
lvItem.ForeColor = Color.DodgerBlue;
@ -324,37 +331,37 @@ namespace v2rayN.Forms
menuServers.Visible = false;
menuServers2.Visible = false;
if (config.vmess.Count > 20)
if (lstVmess.Count > 20)
{
for (int k = 0; k < config.vmess.Count; k++)
for (int k = 0; k < lstVmess.Count; k++)
{
VmessItem item = config.vmess[k];
VmessItem item = lstVmess[k];
string name = item.getSummary();
if (config.index.Equals(k))
if (config.IsActiveNode(item))
{
name = $"√ {name}";
}
menuServers2.Items.Add(name);
}
menuServers2.SelectedIndex = config.index;
menuServers2.SelectedIndex = lstVmess.FindIndex(it => it.indexId == config.indexId);
menuServers2.SelectedIndexChanged += MenuServers2_SelectedIndexChanged;
menuServers2.Visible = true;
}
else
{
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>();
for (int k = 0; k < config.vmess.Count; k++)
for (int k = 0; k < lstVmess.Count; k++)
{
VmessItem item = config.vmess[k];
VmessItem item = lstVmess[k];
string name = item.getSummary();
ToolStripMenuItem ts = new ToolStripMenuItem(name)
{
Tag = k
};
if (config.index.Equals(k))
if (config.IsActiveNode(item))
{
ts.Checked = true;
}
@ -439,7 +446,7 @@ namespace v2rayN.Forms
var tag = lvServers.Columns[e.Column].Tag?.ToString();
bool asc = Utils.IsNullOrEmpty(tag) ? true : !Convert.ToBoolean(tag);
if (ConfigHandler.SortServers(ref config, (EServerColName)e.Column, asc) != 0)
if (ConfigHandler.SortServers(ref config, ref lstVmess, (EServerColName)e.Column, asc) != 0)
{
return;
}
@ -457,6 +464,40 @@ namespace v2rayN.Forms
}
}
private void InitGroupView()
{
tabGroup.TabPages.Clear();
foreach (var item in config.groupItem)
{
var tabPage2 = new TabPage($" {item.remarks} ");
tabPage2.Name = item.id;
tabGroup.TabPages.Add(tabPage2);
}
string title = $" {UIRes.I18N("UngroupedServers")} ";
var tabPage = new TabPage(title);
tabPage.Name = "Ungrouped";
tabGroup.TabPages.Add(tabPage);
tabGroup.SelectedIndex = tabGroup.TabPages.Count - 1;
}
private void tabGroup_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabGroup.SelectedIndex < 0)
{
return;
}
groupId = string.Empty;
if (tabGroup.SelectedIndex < config.groupItem.Count)
{
groupId = config.groupItem[tabGroup.SelectedIndex].id;
}
RefreshServers();
}
#endregion
#region v2ray 操作
@ -520,7 +561,7 @@ namespace v2rayN.Forms
{
return;
}
qrCodeControl.showQRCode(index, config);
qrCodeControl.showQRCode(lstVmess[index]);
}
private void lvServers_DoubleClick(object sender, EventArgs e)
@ -530,7 +571,7 @@ namespace v2rayN.Forms
{
return;
}
ShowServerForm(config.vmess[index].configType, index);
ShowServerForm(lstVmess[index].configType, index);
}
private void ShowServerForm(int configType, int index)
{
@ -556,7 +597,8 @@ namespace v2rayN.Forms
fm = new AddServer2Form();
break;
}
fm.EditIndex = index;
fm.vmessItem = index >= 0 ? lstVmess[index] : null;
fm.groupId = groupId;
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshServers();
@ -646,7 +688,7 @@ namespace v2rayN.Forms
return;
}
ConfigHandler.RemoveServer(ref config, lvSelecteds);
ConfigHandler.RemoveServer(config, lvSelecteds);
RefreshServers();
LoadV2ray();
@ -654,9 +696,9 @@ namespace v2rayN.Forms
private void menuRemoveDuplicateServer_Click(object sender, EventArgs e)
{
int oldCount = config.vmess.Count;
ConfigHandler.DedupServerList(ref config);
int newCount = config.vmess.Count;
int oldCount = lstVmess.Count;
ConfigHandler.DedupServerList(ref config, ref lstVmess);
int newCount = lstVmess.Count;
RefreshServers();
LoadV2ray();
UI.Show(string.Format(UIRes.I18N("RemoveDuplicateServerResult"), oldCount, newCount));
@ -669,7 +711,7 @@ namespace v2rayN.Forms
{
return;
}
if (ConfigHandler.CopyServer(ref config, index) == 0)
if (ConfigHandler.CopyServer(ref config, lstVmess[index]) == 0)
{
RefreshServers();
}
@ -745,13 +787,13 @@ namespace v2rayN.Forms
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
MainFormHandler.Instance.Export2ClientConfig(index, config);
MainFormHandler.Instance.Export2ClientConfig(lstVmess[index], config);
}
private void menuExport2ServerConfig_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
MainFormHandler.Instance.Export2ServerConfig(index, config);
MainFormHandler.Instance.Export2ServerConfig(lstVmess[index], config);
}
private void menuExport2ShareUrl_Click(object sender, EventArgs e)
@ -759,9 +801,9 @@ namespace v2rayN.Forms
GetLvSelectedIndex();
StringBuilder sb = new StringBuilder();
foreach (int v in lvSelecteds)
foreach (var v in lvSelecteds)
{
string url = ShareHandler.GetShareUrl(config, v);
string url = ShareHandler.GetShareUrl(v);
if (Utils.IsNullOrEmpty(url))
{
continue;
@ -782,9 +824,9 @@ namespace v2rayN.Forms
GetLvSelectedIndex();
StringBuilder sb = new StringBuilder();
foreach (int v in lvSelecteds)
foreach (var v in lvSelecteds)
{
string url = ShareHandler.GetShareUrl(config, v);
string url = ShareHandler.GetShareUrl(v);
if (Utils.IsNullOrEmpty(url))
{
continue;
@ -832,6 +874,17 @@ namespace v2rayN.Forms
}
private void tsbGroupSetting_Click(object sender, EventArgs e)
{
var fm = new GroupSettingForm();
if (fm.ShowDialog() == DialogResult.OK)
{
InitGroupView();
RefreshServers();
}
}
private void tsbReload_Click(object sender, EventArgs e)
{
Global.reloadV2ray = true;
@ -857,7 +910,7 @@ namespace v2rayN.Forms
UI.Show(UIRes.I18N("PleaseSelectServer"));
return -1;
}
if (ConfigHandler.SetDefaultServer(ref config, index) == 0)
if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0)
{
RefreshServers();
LoadV2ray();
@ -884,7 +937,7 @@ namespace v2rayN.Forms
index = lvServers.SelectedIndices[0];
foreach (int i in lvServers.SelectedIndices)
{
lvSelecteds.Add(i);
lvSelecteds.Add(lstVmess[i]);
}
return index;
}
@ -913,7 +966,7 @@ namespace v2rayN.Forms
return;
}
if (ConfigHandler.AddCustomServer(ref config, fileName) == 0)
if (ConfigHandler.AddCustomServer(ref config, fileName, groupId) == 0)
{
RefreshServers();
//LoadV2ray();
@ -946,7 +999,7 @@ namespace v2rayN.Forms
private void menuAddServers_Click(object sender, EventArgs e)
{
string clipboardData = Utils.GetClipboardData();
int ret = MainFormHandler.Instance.AddBatchServers(config, clipboardData);
int ret = MainFormHandler.Instance.AddBatchServers(config, clipboardData, "", groupId);
if (ret > 0)
{
RefreshServers();
@ -1114,27 +1167,35 @@ namespace v2rayN.Forms
#endregion
#region 后台测速
private void SetTestResult(string indexId, string txt)
{
int k = lstVmess.FindIndex(it => it.indexId == indexId);
if (k >= 0 && k < lvServers.Items.Count)
{
lstVmess[k].testResult = txt;
lvServers.Items[k].SubItems["testResult"].Text = txt;
}
}
private void SetTestResult(int k, string txt)
{
if (k < lvServers.Items.Count)
{
config.vmess[k].testResult = txt;
lstVmess[k].testResult = txt;
lvServers.Items[k].SubItems["testResult"].Text = txt;
}
}
private void ClearTestResult()
{
foreach (int s in lvSelecteds)
foreach (var s in lvSelecteds)
{
SetTestResult(s, "");
SetTestResult(s.indexId, "");
}
}
private void UpdateSpeedtestHandler(int index, string msg)
private void UpdateSpeedtestHandler(string indexId, string msg)
{
lvServers.Invoke((MethodInvoker)delegate
{
SetTestResult(index, msg);
SetTestResult(indexId, msg);
});
}
@ -1147,9 +1208,9 @@ namespace v2rayN.Forms
toolSslServerSpeed.Text = string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down));
List<string[]> datas = new List<string[]>();
for (int i = 0; i < config.vmess.Count; i++)
for (int i = 0; i < lstVmess.Count; i++)
{
int index = statistics.FindIndex(item_ => item_.itemId == config.vmess[i].getItemId());
int index = statistics.FindIndex(item_ => item_.itemId == lstVmess[i].indexId);
if (index != -1)
{
lvServers.Invoke((MethodInvoker)delegate
@ -1213,7 +1274,7 @@ namespace v2rayN.Forms
UI.Show(UIRes.I18N("PleaseSelectServer"));
return;
}
if (ConfigHandler.MoveServer(ref config, index, eMove) == 0)
if (ConfigHandler.MoveServer(ref config, ref lstVmess, index, eMove) == 0)
{
//TODO: reload is not good.
RefreshServers();
@ -1381,7 +1442,7 @@ namespace v2rayN.Forms
}
else
{
int ret = MainFormHandler.Instance.AddBatchServers(config, result);
int ret = MainFormHandler.Instance.AddBatchServers(config, result, "", groupId);
if (ret > 0)
{
RefreshServers();

File diff suppressed because it is too large Load Diff

View File

@ -118,26 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>301, 622</value>
</data>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="menuAddVmessServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
@ -318,14 +298,25 @@
<data name="tsbServer.Text" xml:space="preserve">
<value> 服务器 </value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器列表</value>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>301, 622</value>
</data>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 136</value>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
@ -363,17 +354,14 @@
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>设置信息过滤器</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 136</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>261, 221</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>260, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>系统代理</value>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value>
@ -393,6 +381,12 @@
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>不改变系统代理</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>260, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>系统代理</value>
</data>
<data name="menuRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>260, 22</value>
</data>
@ -444,11 +438,8 @@
<data name="menuExit.Text" xml:space="preserve">
<value>退出</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>261, 221</value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
@ -468,18 +459,18 @@
<data name="tsbSubUpdateViaProxy.Text" xml:space="preserve">
<value>更新订阅(通过代理)</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbQRCodeSwitch.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 53</value>
</data>
<data name="tsbQRCodeSwitch.Text" xml:space="preserve">
<value> 分享 </value>
</data>
<data name="tsbSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSetting.Text" xml:space="preserve">
<value> 设置 </value>
</data>
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
@ -498,6 +489,12 @@
<data name="tsbGlobalHotkeySetting.Text" xml:space="preserve">
<value>全局热键设置</value>
</data>
<data name="tsbGroupSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
<data name="tsbGroupSetting.Text" xml:space="preserve">
<value>服务器分组设置</value>
</data>
<data name="toolStripSeparator14.Size" type="System.Drawing.Size, System.Drawing">
<value>186, 6</value>
</data>
@ -507,16 +504,11 @@
<data name="tsbBackupGuiNConfig.Text" xml:space="preserve">
<value>备份v2rayN配置文件</value>
</data>
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY
B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg==
</value>
<data name="tsbSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSetting.Text" xml:space="preserve">
<value> 设置 </value>
</data>
<data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
@ -524,12 +516,6 @@
<data name="tsbReload.Text" xml:space="preserve">
<value> 重启服务 </value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
@ -557,11 +543,11 @@
<data name="tsbCheckUpdateGeoIP.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbHelp.Text" xml:space="preserve">
<value> 帮助 </value>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>v2rayN 项目</value>
@ -569,19 +555,18 @@
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
<value>V2Ray 官网</value>
</data>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
</data>
<data name="tsbHelp.Text" xml:space="preserve">
<value> 帮助 </value>
</data>
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 53</value>
</data>
<data name="tsbPromotion.Text" xml:space="preserve">
<value> 推广 </value>
</data>
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsbClose.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
</data>

View File

@ -12,7 +12,7 @@ namespace v2rayN.Forms
}
private void QRCodeControl_Load(object sender, System.EventArgs e)
{
txtUrl.MouseUp += txtUrl_MouseUp;
txtUrl.MouseUp += txtUrl_MouseUp;
}
void txtUrl_MouseUp(object sender, MouseEventArgs e)
@ -20,11 +20,11 @@ namespace v2rayN.Forms
txtUrl.SelectAll();
}
public void showQRCode(int Index, Config config)
public void showQRCode(VmessItem item)
{
if (Index >= 0)
if (item != null)
{
string url = ShareHandler.GetShareUrl(config, Index);
string url = ShareHandler.GetShareUrl(item);
if (Utils.IsNullOrEmpty(url))
{
picQRCode.Image = null;
@ -32,7 +32,7 @@ namespace v2rayN.Forms
return;
}
txtUrl.Text = url;
picQRCode.Image = QRCodeHelper.GetQRCode(url);
picQRCode.Image = QRCodeHelper.GetQRCode(url);
}
}
}

View File

@ -45,6 +45,7 @@
this.menuRemove = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuSetDefaultRouting = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportAdvancedRules = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItemAdvanced = new System.Windows.Forms.ToolStripMenuItem();
this.menuServer = new System.Windows.Forms.MenuStrip();
this.MenuItemBasic = new System.Windows.Forms.ToolStripMenuItem();
@ -70,6 +71,7 @@
this.txtBlockDomain = new System.Windows.Forms.TextBox();
this.tabPageRuleList = new System.Windows.Forms.TabPage();
this.lvRoutings = new v2rayN.Base.ListViewFlickerFree();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.cmsLv.SuspendLayout();
@ -92,24 +94,24 @@
//
// btnClose
//
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.labRoutingTips);
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// labRoutingTips
//
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// btnOK
@ -121,22 +123,22 @@
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Controls.Add(this.cmbdomainMatcher);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.chkenableRoutingAdvanced);
this.panel1.Controls.Add(this.linkLabelRoutingDoc);
this.panel1.Controls.Add(this.cmbdomainStrategy);
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// cmbdomainMatcher
//
resources.ApplyResources(this.cmbdomainMatcher, "cmbdomainMatcher");
this.cmbdomainMatcher.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainMatcher.FormattingEnabled = true;
this.cmbdomainMatcher.Items.AddRange(new object[] {
resources.GetString("cmbdomainMatcher.Items"),
resources.GetString("cmbdomainMatcher.Items1")});
resources.ApplyResources(this.cmbdomainMatcher, "cmbdomainMatcher");
this.cmbdomainMatcher.Name = "cmbdomainMatcher";
//
// label6
@ -160,107 +162,115 @@
//
// cmbdomainStrategy
//
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
//
// cmsLv
//
resources.ApplyResources(this.cmsLv, "cmsLv");
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAdd,
this.menuRemove,
this.menuSelectAll,
this.menuSetDefaultRouting});
this.menuSetDefaultRouting,
this.toolStripSeparator1,
this.menuImportAdvancedRules});
this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.MenuItemAdvanced;
resources.ApplyResources(this.cmsLv, "cmsLv");
//
// menuAdd
//
resources.ApplyResources(this.menuAdd, "menuAdd");
this.menuAdd.Name = "menuAdd";
resources.ApplyResources(this.menuAdd, "menuAdd");
this.menuAdd.Click += new System.EventHandler(this.menuAdd_Click);
//
// menuRemove
//
resources.ApplyResources(this.menuRemove, "menuRemove");
this.menuRemove.Name = "menuRemove";
resources.ApplyResources(this.menuRemove, "menuRemove");
this.menuRemove.Click += new System.EventHandler(this.menuRemove_Click);
//
// menuSelectAll
//
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Name = "menuSelectAll";
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
//
// menuSetDefaultRouting
//
resources.ApplyResources(this.menuSetDefaultRouting, "menuSetDefaultRouting");
this.menuSetDefaultRouting.Name = "menuSetDefaultRouting";
resources.ApplyResources(this.menuSetDefaultRouting, "menuSetDefaultRouting");
this.menuSetDefaultRouting.Click += new System.EventHandler(this.menuSetDefaultRouting_Click);
//
// menuImportAdvancedRules
//
this.menuImportAdvancedRules.Name = "menuImportAdvancedRules";
resources.ApplyResources(this.menuImportAdvancedRules, "menuImportAdvancedRules");
this.menuImportAdvancedRules.Click += new System.EventHandler(this.menuImportAdvancedRules_Click);
//
// MenuItemAdvanced
//
resources.ApplyResources(this.MenuItemAdvanced, "MenuItemAdvanced");
this.MenuItemAdvanced.DropDown = this.cmsLv;
this.MenuItemAdvanced.Name = "MenuItemAdvanced";
resources.ApplyResources(this.MenuItemAdvanced, "MenuItemAdvanced");
//
// menuServer
//
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItemBasic,
this.MenuItemAdvanced});
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// MenuItemBasic
//
resources.ApplyResources(this.MenuItemBasic, "MenuItemBasic");
this.MenuItemBasic.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuImportBasicRules});
this.MenuItemBasic.Name = "MenuItemBasic";
resources.ApplyResources(this.MenuItemBasic, "MenuItemBasic");
//
// menuImportBasicRules
//
resources.ApplyResources(this.menuImportBasicRules, "menuImportBasicRules");
this.menuImportBasicRules.Name = "menuImportBasicRules";
resources.ApplyResources(this.menuImportBasicRules, "menuImportBasicRules");
this.menuImportBasicRules.Click += new System.EventHandler(this.menuImportBasicRules_Click);
//
// tabNormal
//
resources.ApplyResources(this.tabNormal, "tabNormal");
this.tabNormal.Controls.Add(this.tabPageProxy);
this.tabNormal.Controls.Add(this.tabPageDirect);
this.tabNormal.Controls.Add(this.tabPageBlock);
this.tabNormal.Controls.Add(this.tabPageRuleList);
resources.ApplyResources(this.tabNormal, "tabNormal");
this.tabNormal.Name = "tabNormal";
this.tabNormal.SelectedIndex = 0;
this.tabNormal.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabNormal_Selecting);
//
// tabPageProxy
//
resources.ApplyResources(this.tabPageProxy, "tabPageProxy");
this.tabPageProxy.Controls.Add(this.panel5);
resources.ApplyResources(this.tabPageProxy, "tabPageProxy");
this.tabPageProxy.Name = "tabPageProxy";
this.tabPageProxy.UseVisualStyleBackColor = true;
//
// panel5
//
resources.ApplyResources(this.panel5, "panel5");
this.panel5.Controls.Add(this.groupBox5);
this.panel5.Controls.Add(this.groupBox6);
resources.ApplyResources(this.panel5, "panel5");
this.panel5.Name = "panel5";
//
// groupBox5
//
resources.ApplyResources(this.groupBox5, "groupBox5");
this.groupBox5.Controls.Add(this.txtProxyIp);
resources.ApplyResources(this.groupBox5, "groupBox5");
this.groupBox5.Name = "groupBox5";
this.groupBox5.TabStop = false;
//
@ -271,8 +281,8 @@
//
// groupBox6
//
resources.ApplyResources(this.groupBox6, "groupBox6");
this.groupBox6.Controls.Add(this.txtProxyDomain);
resources.ApplyResources(this.groupBox6, "groupBox6");
this.groupBox6.Name = "groupBox6";
this.groupBox6.TabStop = false;
//
@ -283,22 +293,22 @@
//
// tabPageDirect
//
resources.ApplyResources(this.tabPageDirect, "tabPageDirect");
this.tabPageDirect.Controls.Add(this.panel4);
resources.ApplyResources(this.tabPageDirect, "tabPageDirect");
this.tabPageDirect.Name = "tabPageDirect";
this.tabPageDirect.UseVisualStyleBackColor = true;
//
// panel4
//
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.groupBox3);
this.panel4.Controls.Add(this.groupBox4);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// groupBox3
//
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.Controls.Add(this.txtDirectIp);
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
@ -309,8 +319,8 @@
//
// groupBox4
//
resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.Controls.Add(this.txtDirectDomain);
resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.Name = "groupBox4";
this.groupBox4.TabStop = false;
//
@ -321,22 +331,22 @@
//
// tabPageBlock
//
resources.ApplyResources(this.tabPageBlock, "tabPageBlock");
this.tabPageBlock.Controls.Add(this.panel3);
resources.ApplyResources(this.tabPageBlock, "tabPageBlock");
this.tabPageBlock.Name = "tabPageBlock";
this.tabPageBlock.UseVisualStyleBackColor = true;
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.groupBox2);
this.panel3.Controls.Add(this.groupBox1);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.txtBlockIp);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
@ -347,8 +357,8 @@
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.txtBlockDomain);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
@ -359,15 +369,15 @@
//
// tabPageRuleList
//
resources.ApplyResources(this.tabPageRuleList, "tabPageRuleList");
this.tabPageRuleList.Controls.Add(this.lvRoutings);
resources.ApplyResources(this.tabPageRuleList, "tabPageRuleList");
this.tabPageRuleList.Name = "tabPageRuleList";
this.tabPageRuleList.UseVisualStyleBackColor = true;
//
// lvRoutings
//
resources.ApplyResources(this.lvRoutings, "lvRoutings");
this.lvRoutings.ContextMenuStrip = this.cmsLv;
resources.ApplyResources(this.lvRoutings, "lvRoutings");
this.lvRoutings.FullRowSelect = true;
this.lvRoutings.GridLines = true;
this.lvRoutings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
@ -380,6 +390,11 @@
this.lvRoutings.View = System.Windows.Forms.View.Details;
this.lvRoutings.DoubleClick += new System.EventHandler(this.lvRoutings_DoubleClick);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// RoutingSettingForm
//
resources.ApplyResources(this, "$this");
@ -464,5 +479,7 @@
private System.Windows.Forms.ToolStripMenuItem menuImportBasicRules;
private System.Windows.Forms.ComboBox cmbdomainMatcher;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ToolStripMenuItem menuImportAdvancedRules;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
}
}

View File

@ -304,6 +304,14 @@ namespace v2rayN.Forms
UI.Show(UIRes.I18N("OperationSuccess"));
}
private void menuImportAdvancedRules_Click(object sender, EventArgs e)
{
if (ConfigHandler.InitBuiltinRouting(ref config, true) == 0)
{
RefreshRoutingsView();
}
}
#endregion
}

File diff suppressed because it is too large Load Diff

View File

@ -124,6 +124,12 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 545</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 60</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>518, 16</value>
</data>
@ -136,11 +142,8 @@
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 545</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 60</value>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 51</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
@ -160,8 +163,8 @@
<data name="linkLabelRoutingDoc.Text" xml:space="preserve">
<value>域名解析策略</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 51</value>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 114</value>
</data>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
@ -193,14 +196,8 @@
<data name="MenuItemAdvanced.Text" xml:space="preserve">
<value>高级功能</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 92</value>
</data>
<data name="menuImportBasicRules.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value>
</data>
<data name="menuImportBasicRules.Text" xml:space="preserve">
<value>一键导入基础规则</value>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 25</value>
</data>
<data name="MenuItemBasic.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
@ -208,23 +205,14 @@
<data name="MenuItemBasic.Text" xml:space="preserve">
<value>基础功能</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 25</value>
<data name="menuImportBasicRules.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="txtProxyIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
<data name="menuImportBasicRules.Text" xml:space="preserve">
<value>一键导入基础规则</value>
</data>
<data name="groupBox5.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtProxyDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="groupBox6.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="panel5.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
<data name="tabNormal.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 469</value>
</data>
<data name="tabPageProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
@ -232,20 +220,20 @@
<data name="tabPageProxy.Text" xml:space="preserve">
<value> 1.代理的Domain或IP </value>
</data>
<data name="txtDirectIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
<data name="panel5.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox3.Size" type="System.Drawing.Size, System.Drawing">
<data name="groupBox5.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtDirectDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
<data name="txtProxyIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox4.Size" type="System.Drawing.Size, System.Drawing">
<data name="groupBox6.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
<data name="txtProxyDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageDirect.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
@ -253,20 +241,20 @@
<data name="tabPageDirect.Text" xml:space="preserve">
<value> 2.直连的Domain或IP </value>
</data>
<data name="txtBlockIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<data name="groupBox3.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtBlockDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
<data name="txtDirectIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<data name="groupBox4.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
<data name="txtDirectDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageBlock.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
@ -274,6 +262,27 @@
<data name="tabPageBlock.Text" xml:space="preserve">
<value> 3.阻止的Domain或IP </value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtBlockIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="txtBlockDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageRuleList.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageRuleList.Text" xml:space="preserve">
<value> 预定义规则集列表</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
@ -294,14 +303,8 @@
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="tabPageRuleList.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageRuleList.Text" xml:space="preserve">
<value> 预定义规则集列表</value>
</data>
<data name="tabNormal.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 469</value>
<data name="menuImportAdvancedRules.Text" xml:space="preserve">
<value>一键导入高级规则</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>817, 605</value>

View File

@ -30,6 +30,8 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingControl));
this.grbMain = new System.Windows.Forms.GroupBox();
this.label4 = new System.Windows.Forms.Label();
this.cmbGroup = new System.Windows.Forms.ComboBox();
this.txtUserAgent = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.btnShare = new System.Windows.Forms.Button();
@ -47,6 +49,8 @@
// grbMain
//
resources.ApplyResources(this.grbMain, "grbMain");
this.grbMain.Controls.Add(this.label4);
this.grbMain.Controls.Add(this.cmbGroup);
this.grbMain.Controls.Add(this.txtUserAgent);
this.grbMain.Controls.Add(this.label1);
this.grbMain.Controls.Add(this.btnShare);
@ -59,6 +63,19 @@
this.grbMain.Name = "grbMain";
this.grbMain.TabStop = false;
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// cmbGroup
//
resources.ApplyResources(this.cmbGroup, "cmbGroup");
this.cmbGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbGroup.FormattingEnabled = true;
this.cmbGroup.Name = "cmbGroup";
this.cmbGroup.Leave += new System.EventHandler(this.txtRemarks_Leave);
//
// txtUserAgent
//
resources.ApplyResources(this.txtUserAgent, "txtUserAgent");
@ -147,5 +164,7 @@
private System.Windows.Forms.PictureBox picQRCode;
private System.Windows.Forms.TextBox txtUserAgent;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cmbGroup;
}
}

View File

@ -3,6 +3,8 @@ using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
using System.Linq;
using System.Collections.Generic;
namespace v2rayN.Forms
{
@ -10,7 +12,7 @@ namespace v2rayN.Forms
public partial class SubSettingControl : UserControl
{
public event ChangeEventHandler OnButtonClicked;
private List<GroupItem> groupItem;
public SubItem subItem
{
@ -25,6 +27,12 @@ namespace v2rayN.Forms
private void SubSettingControl_Load(object sender, EventArgs e)
{
this.Height = grbMain.Height;
groupItem = LazyConfig.Instance.GetConfig().groupItem;
cmbGroup.Items.AddRange(groupItem.Select(t => t.remarks).ToArray());
cmbGroup.Items.Add(string.Empty);
BindingSub();
}
@ -36,6 +44,12 @@ namespace v2rayN.Forms
txtUrl.Text = subItem.url.ToString();
chkEnabled.Checked = subItem.enabled;
txtUserAgent.Text = subItem.userAgent;
var index = groupItem.FindIndex(t => t.id == subItem.groupId);
if (index >= 0)
{
cmbGroup.SelectedIndex = index;
}
}
}
private void EndBindingSub()
@ -46,6 +60,12 @@ namespace v2rayN.Forms
subItem.url = txtUrl.Text.TrimEx();
subItem.enabled = chkEnabled.Checked;
subItem.userAgent = txtUserAgent.Text.TrimEx();
var index = groupItem.FindIndex(t => t.remarks == cmbGroup.Text);
if (index >= 0)
{
subItem.groupId = groupItem[index].id;
}
}
}
private void txtRemarks_Leave(object sender, EventArgs e)

View File

@ -131,17 +131,20 @@
<data name="picQRCode.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 162</value>
</data>
<data name="&gt;&gt;txtUserAgent.ZOrder" xml:space="preserve">
<value>0</value>
<data name="cmbGroup.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 147</value>
</data>
<data name="chkEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 16</value>
</data>
<data name="&gt;&gt;cmbGroup.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtUrl.Name" xml:space="preserve">
<value>txtUrl</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>8</value>
<data name="&gt;&gt;cmbGroup.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;picQRCode.Name" xml:space="preserve">
<value>picQRCode</value>
@ -177,6 +180,9 @@
<data name="btnShare.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="&gt;&gt;grbMain.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
@ -186,12 +192,18 @@
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
</data>
<data name="btnShare.Location" type="System.Drawing.Point, System.Drawing">
<value>434, 21</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="&gt;&gt;cmbGroup.Name" xml:space="preserve">
<value>cmbGroup</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 21</value>
</data>
@ -213,17 +225,20 @@
<data name="btnShare.Text" xml:space="preserve">
<value>Share</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;chkEnabled.ZOrder" xml:space="preserve">
<value>3</value>
<value>5</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 53</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="picQRCode.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -231,14 +246,17 @@
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>27</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtUserAgent.Size" type="System.Drawing.Size, System.Drawing">
<value>473, 21</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>125, 12</value>
</data>
<data name="picQRCode.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 53</value>
@ -250,14 +268,23 @@
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtUrl.ZOrder" xml:space="preserve">
<value>5</value>
<value>7</value>
</data>
<data name="picQRCode.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
<value>Zoom</value>
<data name="&gt;&gt;chkEnabled.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="cmbGroup.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 20</value>
</data>
<data name="&gt;&gt;txtUserAgent.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
@ -276,11 +303,20 @@
<data name="&gt;&gt;chkEnabled.Name" xml:space="preserve">
<value>chkEnabled</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>6</value>
<data name="picQRCode.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
<value>Zoom</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="picQRCode.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Belong to Group</value>
</data>
<data name="cmbGroup.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
@ -288,14 +324,11 @@
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="picQRCode.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 148</value>
</data>
<data name="btnShare.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>4</value>
<value>6</value>
</data>
<data name="&gt;&gt;btnShare.Parent" xml:space="preserve">
<value>grbMain</value>
@ -303,20 +336,26 @@
<data name="chkEnabled.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtUserAgent.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="grbMain.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="&gt;&gt;cmbGroup.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="grbMain.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="txtUserAgent.Size" type="System.Drawing.Size, System.Drawing">
<value>473, 21</value>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>368, 23</value>
@ -333,9 +372,6 @@
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -351,20 +387,23 @@
<data name="&gt;&gt;grbMain.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>grbMain</value>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="grbMain.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 148</value>
<value>619, 188</value>
</data>
<data name="&gt;&gt;btnShare.Name" xml:space="preserve">
<value>btnShare</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 350</value>
</data>
<data name="&gt;&gt;btnShare.ZOrder" xml:space="preserve">
<value>2</value>
<value>4</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>7</value>
<value>9</value>
</data>
<data name="chkEnabled.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -372,8 +411,8 @@
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 115</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 310</value>
<data name="picQRCode.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 188</value>
</data>
<data name="&gt;&gt;txtUserAgent.Name" xml:space="preserve">
<value>txtUserAgent</value>
@ -381,8 +420,8 @@
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="picQRCode.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -396,7 +435,13 @@
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;chkEnabled.Parent" xml:space="preserve">
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 151</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve">
@ -411,6 +456,9 @@
<data name="&gt;&gt;btnRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
@ -420,8 +468,8 @@
<data name="&gt;&gt;grbMain.Name" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;grbMain.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@ -432,6 +480,9 @@
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View File

@ -118,6 +118,12 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>所属分组</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>101, 12</value>
</data>

View File

@ -157,7 +157,7 @@
<value>0, 0</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>614, 351</value>
<value>634, 401</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
@ -232,10 +232,10 @@
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 351</value>
<value>0, 401</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>614, 60</value>
<value>634, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
@ -259,7 +259,7 @@
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>614, 411</value>
<value>634, 461</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Subscription settings</value>

View File

@ -45,7 +45,6 @@ namespace v2rayN.Handler
{
config = new Config
{
index = -1,
logEnabled = false,
loglevel = "warning",
vmess = new List<VmessItem>(),
@ -53,9 +52,6 @@ namespace v2rayN.Handler
//Mux
muxEnabled = false,
////默认监听端口
//config.pacPort = 8888;
// 默认不开启统计
enableStatistics = false,
@ -89,7 +85,6 @@ namespace v2rayN.Handler
}
else
{
//http协议不由core提供,只保留socks
if (config.inbound.Count > 0)
{
config.inbound[0].protocol = Global.InboundSocks;
@ -157,11 +152,14 @@ namespace v2rayN.Handler
{
config.subItem = new List<SubItem>();
}
if (config.groupItem == null)
{
config.groupItem = new List<GroupItem>();
}
if (config == null
|| config.index < 0
|| config.vmess.Count <= 0
|| config.index > config.vmess.Count - 1
)
{
Global.reloadV2ray = false;
@ -196,9 +194,8 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddServer(ref Config config, VmessItem vmessItem, int index, bool toFile = true)
public static int AddServer(ref Config config, VmessItem vmessItem, bool toFile = true)
{
vmessItem.configType = (int)EConfigType.Vmess;
@ -216,19 +213,7 @@ namespace v2rayN.Handler
return -1;
}
if (index >= 0)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
}
else
{
AddServerCommon(ref config, vmessItem);
}
AddServerCommon(ref config, vmessItem);
if (toFile)
{
@ -241,25 +226,19 @@ namespace v2rayN.Handler
/// 移除服务器
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <param name="indexs"></param>
/// <returns></returns>
public static int RemoveServer(ref Config config, List<int> indexs)
public static int RemoveServer(Config config, List<VmessItem> indexs)
{
var indexId = config.indexId();
for (int k = indexs.Count - 1; k >= 0; k--)
foreach (var item in indexs)
{
var index = indexs[k];
if (index < 0 || index > config.vmess.Count - 1)
var index = config.FindIndexId(item.indexId);
if (index >= 0)
{
continue;
config.vmess.RemoveAt(index);
}
config.vmess.RemoveAt(index);
}
SetIndex(ref config, indexId);
ToJsonFile(config);
return 0;
@ -271,34 +250,33 @@ namespace v2rayN.Handler
/// <param name="config"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int CopyServer(ref Config config, int index)
public static int CopyServer(ref Config config, VmessItem item)
{
if (index < 0 || index > config.vmess.Count - 1)
if (item == null)
{
return -1;
}
VmessItem vmessItem = new VmessItem
{
configVersion = config.vmess[index].configVersion,
address = config.vmess[index].address,
port = config.vmess[index].port,
id = config.vmess[index].id,
alterId = config.vmess[index].alterId,
security = config.vmess[index].security,
network = config.vmess[index].network,
remarks = string.Format("{0}-clone", config.vmess[index].remarks),
headerType = config.vmess[index].headerType,
requestHost = config.vmess[index].requestHost,
path = config.vmess[index].path,
streamSecurity = config.vmess[index].streamSecurity,
allowInsecure = config.vmess[index].allowInsecure,
configType = config.vmess[index].configType,
flow = config.vmess[index].flow,
sni = config.vmess[index].sni
configVersion = item.configVersion,
address = item.address,
port = item.port,
id = item.id,
alterId = item.alterId,
security = item.security,
network = item.network,
remarks = string.Format("{0}-clone", item.remarks),
headerType = item.headerType,
requestHost = item.requestHost,
path = item.path,
streamSecurity = item.streamSecurity,
allowInsecure = item.allowInsecure,
configType = item.configType,
flow = item.flow,
sni = item.sni
};
//config.vmess.Insert(index + 1, vmessItem); // 插入到下一项
AddServerCommon(ref config, vmessItem);
ToJsonFile(config);
@ -310,21 +288,16 @@ namespace v2rayN.Handler
/// 设置活动服务器
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <param name="item"></param>
/// <returns></returns>
public static int SetDefaultServer(ref Config config, int index)
public static int SetDefaultServer(ref Config config, VmessItem item)
{
if (index < 0 || index > config.vmess.Count - 1)
if (item == null)
{
return -1;
}
////和现在相同
//if (config.index.Equals(index))
//{
// return -1;
//}
config.index = index;
config.indexId = item.indexId;
Global.reloadV2ray = true;
ToJsonFile(config);
@ -332,6 +305,42 @@ namespace v2rayN.Handler
return 0;
}
public static int SetDefaultServer(Config config, List<VmessItem> lstVmess)
{
if (lstVmess.Exists(t => t.indexId == config.indexId))
{
return 0;
}
if (config.vmess.Exists(t => t.indexId == config.indexId))
{
return 0;
}
if (lstVmess.Count > 0)
{
return SetDefaultServer(ref config, lstVmess[0]);
}
if (config.vmess.Count > 0)
{
return SetDefaultServer(ref config, config.vmess[0]);
}
return -1;
}
public static VmessItem GetDefaultServer(ref Config config)
{
if (config.vmess.Count <= 0)
{
return null;
}
var index = config.FindIndexId(config.indexId);
if (index < 0)
{
SetDefaultServer(ref config, config.vmess[0]);
return config.vmess[0];
}
return config.vmess[index];
}
/// <summary>
/// 保参数
/// </summary>
@ -359,16 +368,23 @@ namespace v2rayN.Handler
/// 移动服务器
/// </summary>
/// <param name="config"></param>
/// <param name="lstVmess"></param>
/// <param name="index"></param>
/// <param name="eMove"></param>
/// <returns></returns>
public static int MoveServer(ref Config config, int index, EMove eMove)
public static int MoveServer(ref Config config, ref List<VmessItem> lstVmess, int index, EMove eMove)
{
int count = config.vmess.Count;
if (index < 0 || index > config.vmess.Count - 1)
int count = lstVmess.Count;
if (index < 0 || index > lstVmess.Count - 1)
{
return -1;
}
for (int i = 0; i < lstVmess.Count; i++)
{
lstVmess[i].sort = (i + 1) * 10;
}
switch (eMove)
{
case EMove.Top:
@ -377,21 +393,8 @@ namespace v2rayN.Handler
{
return 0;
}
VmessItem vmess = Utils.DeepCopy(config.vmess[index]);
config.vmess.RemoveAt(index);
config.vmess.Insert(0, vmess);
if (index < config.index)
{
//
}
else if (config.index == index)
{
config.index = 0;
}
else
{
config.index++;
}
lstVmess[index].sort = lstVmess[0].sort - 1;
break;
}
case EMove.Up:
@ -400,17 +403,8 @@ namespace v2rayN.Handler
{
return 0;
}
VmessItem vmess = Utils.DeepCopy(config.vmess[index]);
config.vmess.RemoveAt(index);
config.vmess.Insert(index - 1, vmess);
if (index == config.index + 1)
{
config.index++;
}
else if (config.index == index)
{
config.index--;
}
lstVmess[index].sort = lstVmess[index - 1].sort - 1;
break;
}
@ -420,17 +414,8 @@ namespace v2rayN.Handler
{
return 0;
}
VmessItem vmess = Utils.DeepCopy(config.vmess[index]);
config.vmess.RemoveAt(index);
config.vmess.Insert(index + 1, vmess);
if (index == config.index - 1)
{
config.index--;
}
else if (config.index == index)
{
config.index++;
}
lstVmess[index].sort = lstVmess[index + 1].sort + 1;
break;
}
case EMove.Bottom:
@ -439,26 +424,11 @@ namespace v2rayN.Handler
{
return 0;
}
VmessItem vmess = Utils.DeepCopy(config.vmess[index]);
config.vmess.RemoveAt(index);
config.vmess.Add(vmess);
if (index < config.index)
{
config.index--;
}
else if (config.index == index)
{
config.index = count - 1;
}
else
{
//
}
lstVmess[index].sort = lstVmess[lstVmess.Count - 1].sort + 1;
break;
}
}
Global.reloadV2ray = true;
ToJsonFile(config);
@ -471,7 +441,7 @@ namespace v2rayN.Handler
/// <param name="config"></param>
/// <param name="fileName"></param>
/// <returns></returns>
public static int AddCustomServer(ref Config config, string fileName)
public static int AddCustomServer(ref Config config, string fileName, string groupId)
{
string newFileName = string.Format("{0}.json", Utils.GetGUID());
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
@ -487,17 +457,13 @@ namespace v2rayN.Handler
VmessItem vmessItem = new VmessItem
{
groupId = groupId,
address = newFileName,
configType = (int)EConfigType.Custom,
remarks = string.Format("import custom@{0}", DateTime.Now.ToShortDateString())
};
config.vmess.Add(vmessItem);
if (config.vmess.Count == 1)
{
config.index = 0;
Global.reloadV2ray = true;
}
AddServerCommon(ref config, vmessItem);
ToJsonFile(config);
@ -509,17 +475,9 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int EditCustomServer(ref Config config, VmessItem vmessItem, int index)
public static int EditCustomServer(ref Config config, VmessItem vmessItem)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
ToJsonFile(config);
return 0;
@ -530,9 +488,8 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddShadowsocksServer(ref Config config, VmessItem vmessItem, int index, bool toFile = true)
public static int AddShadowsocksServer(ref Config config, VmessItem vmessItem, bool toFile = true)
{
vmessItem.configType = (int)EConfigType.Shadowsocks;
@ -545,19 +502,7 @@ namespace v2rayN.Handler
return -1;
}
if (index >= 0)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
}
else
{
AddServerCommon(ref config, vmessItem);
}
AddServerCommon(ref config, vmessItem);
if (toFile)
{
@ -572,27 +517,14 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddSocksServer(ref Config config, VmessItem vmessItem, int index, bool toFile = true)
public static int AddSocksServer(ref Config config, VmessItem vmessItem, bool toFile = true)
{
vmessItem.configType = (int)EConfigType.Socks;
vmessItem.address = vmessItem.address.TrimEx();
if (index >= 0)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
}
else
{
AddServerCommon(ref config, vmessItem);
}
AddServerCommon(ref config, vmessItem);
if (toFile)
{
@ -608,9 +540,8 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddTrojanServer(ref Config config, VmessItem vmessItem, int index, bool toFile = true)
public static int AddTrojanServer(ref Config config, VmessItem vmessItem, bool toFile = true)
{
vmessItem.configType = (int)EConfigType.Trojan;
@ -625,19 +556,7 @@ namespace v2rayN.Handler
vmessItem.allowInsecure = config.defAllowInsecure.ToString();
}
if (index >= 0)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
}
else
{
AddServerCommon(ref config, vmessItem);
}
AddServerCommon(ref config, vmessItem);
if (toFile)
{
@ -719,14 +638,13 @@ namespace v2rayN.Handler
/// <param name="clipboardData"></param>
/// <param name="subid"></param>
/// <returns>成功导入的数量</returns>
public static int AddBatchServers(ref Config config, string clipboardData, string subid = "")
public static int AddBatchServers(ref Config config, string clipboardData, string subid, string groupId)
{
if (Utils.IsNullOrEmpty(clipboardData))
{
return -1;
}
var indexId = config.indexId();
//copy sub items
List<VmessItem> lstOriSub = null;
if (!Utils.IsNullOrEmpty(subid))
@ -770,45 +688,46 @@ namespace v2rayN.Handler
vmessItem.subid = subid;
}
//groupId
vmessItem.groupId = groupId;
if (vmessItem.configType == (int)EConfigType.Vmess)
{
if (AddServer(ref config, vmessItem, -1, false) == 0)
if (AddServer(ref config, vmessItem, false) == 0)
{
countServers++;
}
}
else if (vmessItem.configType == (int)EConfigType.Shadowsocks)
{
if (AddShadowsocksServer(ref config, vmessItem, -1, false) == 0)
if (AddShadowsocksServer(ref config, vmessItem, false) == 0)
{
countServers++;
}
}
else if (vmessItem.configType == (int)EConfigType.Socks)
{
if (AddSocksServer(ref config, vmessItem, -1, false) == 0)
if (AddSocksServer(ref config, vmessItem, false) == 0)
{
countServers++;
}
}
else if (vmessItem.configType == (int)EConfigType.Trojan)
{
if (AddTrojanServer(ref config, vmessItem, -1, false) == 0)
if (AddTrojanServer(ref config, vmessItem, false) == 0)
{
countServers++;
}
}
else if (vmessItem.configType == (int)EConfigType.VLESS)
{
if (AddVlessServer(ref config, vmessItem, -1, false) == 0)
if (AddVlessServer(ref config, vmessItem, false) == 0)
{
countServers++;
}
}
}
SetIndex(ref config, indexId);
ToJsonFile(config);
return countServers;
}
@ -850,11 +769,11 @@ namespace v2rayN.Handler
return -1;
}
foreach (SubItem sub in config.subItem)
foreach (SubItem item in config.subItem)
{
if (Utils.IsNullOrEmpty(sub.id))
if (Utils.IsNullOrEmpty(item.id))
{
sub.id = Utils.GetGUID(false);
item.id = Utils.GetGUID(false);
}
}
@ -870,7 +789,6 @@ namespace v2rayN.Handler
/// <returns></returns>
public static int RemoveServerViaSubid(ref Config config, string subid)
{
var indexId = config.indexId();
if (Utils.IsNullOrEmpty(subid) || config.vmess.Count <= 0)
{
return -1;
@ -883,15 +801,13 @@ namespace v2rayN.Handler
}
}
SetIndex(ref config, indexId);
ToJsonFile(config);
return 0;
}
public static int SortServers(ref Config config, EServerColName name, bool asc)
public static int SortServers(ref Config config, ref List<VmessItem> lstVmess, EServerColName name, bool asc)
{
if (config.vmess.Count <= 0)
if (lstVmess.Count <= 0)
{
return -1;
}
@ -915,19 +831,20 @@ namespace v2rayN.Handler
return -1;
}
var indexId = config.indexId();
var items = config.vmess.AsQueryable();
var items = lstVmess.AsQueryable();
if (asc)
{
config.vmess = items.OrderBy(propertyName).ToList();
lstVmess = items.OrderBy(propertyName).ToList();
}
else
{
config.vmess = items.OrderByDescending(propertyName).ToList();
lstVmess = items.OrderByDescending(propertyName).ToList();
}
for (int i = 0; i < lstVmess.Count; i++)
{
lstVmess[i].sort = (i + 1) * 10;
}
SetIndex(ref config, indexId);
ToJsonFile(config);
return 0;
@ -938,9 +855,8 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddVlessServer(ref Config config, VmessItem vmessItem, int index, bool toFile = true)
public static int AddVlessServer(ref Config config, VmessItem vmessItem, bool toFile = true)
{
vmessItem.configType = (int)EConfigType.VLESS;
@ -953,19 +869,7 @@ namespace v2rayN.Handler
vmessItem.path = vmessItem.path.TrimEx();
vmessItem.streamSecurity = vmessItem.streamSecurity.TrimEx();
if (index >= 0)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
}
else
{
AddServerCommon(ref config, vmessItem);
}
AddServerCommon(ref config, vmessItem);
if (toFile)
{
@ -975,11 +879,9 @@ namespace v2rayN.Handler
return 0;
}
public static int DedupServerList(ref Config config)
public static int DedupServerList(ref Config config, ref List<VmessItem> lstVmess)
{
var indexId = config.indexId();
List<VmessItem> source = config.vmess;
List<VmessItem> source = lstVmess;
bool keepOlder = config.keepOlderDedupl;
List<VmessItem> list = new List<VmessItem>();
@ -991,21 +893,23 @@ namespace v2rayN.Handler
{
list.Add(item);
}
else
{
var index = config.FindIndexId(item.indexId);
if (index >= 0)
{
config.vmess.RemoveAt(index);
}
}
}
if (!keepOlder) list.Reverse();
config.vmess = list;
SetIndex(ref config, indexId);
//if (!keepOlder) list.Reverse();
//config.vmess = list;
return 0;
}
public static int AddServerCommon(ref Config config, VmessItem vmessItem)
{
if (Utils.IsNullOrEmpty(vmessItem.indexId))
{
vmessItem.indexId = Utils.GetGUID(false);
}
vmessItem.configVersion = 2;
if (Utils.IsNullOrEmpty(vmessItem.allowInsecure))
{
@ -1016,39 +920,23 @@ namespace v2rayN.Handler
vmessItem.network = Global.DefaultNetwork;
}
config.vmess.Add(vmessItem);
if (config.vmess.Count == 1)
if (Utils.IsNullOrEmpty(vmessItem.indexId))
{
config.index = 0;
Global.reloadV2ray = true;
vmessItem.indexId = Utils.GetGUID(false);
}
return 0;
}
if (!config.vmess.Exists(it => it.indexId == vmessItem.indexId))
{
var maxSort = config.vmess.Max(t => t.sort);
vmessItem.sort = maxSort++;
public static int SetIndex(ref Config config, string indexId)
{
var index_ = config.FindIndexId(indexId);
config.vmess.Add(vmessItem);
}
if (config.index == index_)
{
return 0;
}
else if (index_ >= 0)
{
config.index = index_;
}
else
{
if (config.vmess.Count > 0)
{
config.index = 0;
}
else
{
config.index = -1;
}
}
Global.reloadV2ray = true;
//if (config.vmess.Count == 1)
//{
// config.indexId = config.vmess[0].indexId;
// Global.reloadV2ray = true;
//}
return 0;
}
@ -1075,6 +963,55 @@ namespace v2rayN.Handler
&& (remarks ? o.remarks == n.remarks : true);
}
/// <summary>
/// save Group
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
public static int SaveGroupItem(ref Config config)
{
if (config.groupItem == null || config.groupItem.Count <= 0)
{
return -1;
}
foreach (GroupItem item in config.groupItem)
{
if (Utils.IsNullOrEmpty(item.id))
{
item.id = Utils.GetGUID(false);
}
}
ToJsonFile(config);
return 0;
}
public static int RemoveGroupItem(ref Config config, string groupId)
{
if (Utils.IsNullOrEmpty(groupId) || config.vmess.Count <= 0)
{
return -1;
}
foreach (var item in config.vmess)
{
if (item.groupId.Equals(groupId))
{
item.groupId = string.Empty;
}
}
foreach (var item in config.subItem)
{
if (item.groupId.Equals(groupId))
{
item.groupId = string.Empty;
}
}
ToJsonFile(config);
return 0;
}
#endregion
#region UI
@ -1290,14 +1227,14 @@ namespace v2rayN.Handler
return 0;
}
public static int InitBuiltinRouting(ref Config config)
public static int InitBuiltinRouting(ref Config config, bool blImportAdvancedRules = false)
{
if (config.routings == null)
{
config.routings = new List<RoutingItem>();
}
if (config.routings.Count(it => it.locked != true) <= 0)
if (blImportAdvancedRules || config.routings.Count(it => it.locked != true) <= 0)
{
//Bypass the mainland
var item2 = new RoutingItem()
@ -1326,7 +1263,10 @@ namespace v2rayN.Handler
AddBatchRoutingRules(ref item1, Utils.GetEmbedText(Global.CustomRoutingFileName + "global"));
config.routings.Add(item1);
config.routingIndex = 0;
if (!blImportAdvancedRules)
{
config.routingIndex = 0;
}
}
if (GetLockedRoutingItem(ref config) == null)

View File

@ -77,15 +77,14 @@ namespace v2rayN.Handler
}
}
public void Export2ClientConfig(int index, Config config)
public void Export2ClientConfig(VmessItem item, Config config)
{
//int index = GetLvSelectedIndex();
if (index < 0)
if (item == null)
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess
&& config.vmess[index].configType != (int)EConfigType.VLESS)
if (item.configType != (int)EConfigType.Vmess
&& item.configType != (int)EConfigType.VLESS)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
@ -106,9 +105,9 @@ namespace v2rayN.Handler
{
return;
}
Config configCopy = Utils.DeepCopy(config);
configCopy.index = index;
if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out string msg) != 0)
//Config configCopy = Utils.DeepCopy(config);
//configCopy.index = index;
if (V2rayConfigHandler.Export2ClientConfig(item, fileName, out string msg) != 0)
{
UI.Show(msg);
}
@ -118,15 +117,14 @@ namespace v2rayN.Handler
}
}
public void Export2ServerConfig(int index, Config config)
public void Export2ServerConfig(VmessItem item, Config config)
{
//int index = GetLvSelectedIndex();
if (index < 0)
if (item == null)
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess
&& config.vmess[index].configType != (int)EConfigType.VLESS)
if (item.configType != (int)EConfigType.Vmess
&& item.configType != (int)EConfigType.VLESS)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
@ -147,9 +145,9 @@ namespace v2rayN.Handler
{
return;
}
Config configCopy = Utils.DeepCopy(config);
configCopy.index = index;
if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out string msg) != 0)
//Config configCopy = Utils.DeepCopy(config);
//configCopy.index = index;
if (V2rayConfigHandler.Export2ServerConfig(item, fileName, out string msg) != 0)
{
UI.Show(msg);
}
@ -159,12 +157,12 @@ namespace v2rayN.Handler
}
}
public int AddBatchServers(Config config, string clipboardData, string subid = "")
public int AddBatchServers(Config config, string clipboardData, string subid, string groupId)
{
int counter;
int _Add()
{
return ConfigHandler.AddBatchServers(ref config, clipboardData, subid);
return ConfigHandler.AddBatchServers(ref config, clipboardData, subid, groupId);
}
counter = _Add();
if (counter < 1)
@ -227,12 +225,12 @@ namespace v2rayN.Handler
var updateHandle = new UpdateHandle();
while (true)
{
Utils.SaveLog("UpdateTaskRun");
Thread.Sleep(60000);
if (config.autoUpdateInterval <= 0)
{
continue;
}
Utils.SaveLog("UpdateTaskRun");
updateHandle.UpdateGeoFile("geosite", config, (bool success, string msg) =>
{

View File

@ -20,16 +20,14 @@ namespace v2rayN.Handler
/// <summary>
/// GetShareUrl
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <param name="item"></param>
/// <returns></returns>
public static string GetShareUrl(Config config, int index)
public static string GetShareUrl(VmessItem item)
{
try
{
string url = string.Empty;
VmessItem item = config.vmess[index];
switch (item.configType)
{
case (int)EConfigType.Vmess:
@ -297,7 +295,7 @@ namespace v2rayN.Handler
}
return 0;
}
#endregion
#region ImportShareUrl
@ -635,7 +633,7 @@ namespace v2rayN.Handler
Match details;
try
{
details = DetailsParser.Match(Utils.Base64Decode(base64));
details = DetailsParser.Match(Utils.Base64Decode(base64));
}
catch (FormatException)
{
@ -726,7 +724,7 @@ namespace v2rayN.Handler
{
server.security = userInfoParts[0];
server.id = userInfoParts[1];
}
}
return server;
}
@ -775,7 +773,7 @@ namespace v2rayN.Handler
private static int ResolveStdTransport(NameValueCollection query, ref VmessItem item)
{
item.flow = query["flow"] ?? "";
item.flow = query["flow"] ?? "";
item.streamSecurity = query["security"] ?? "";
item.sni = query["sni"] ?? "";
item.alpn = Utils.String2List(Utils.UrlDecode(query["alpn"] ?? ""));

View File

@ -14,14 +14,14 @@ namespace v2rayN.Handler
private Config _config;
private V2rayHandler _v2rayHandler;
private List<ServerTestItem> _selecteds;
Action<int, string> _updateFunc;
Action<string, string> _updateFunc;
public SpeedtestHandler(ref Config config)
{
_config = config;
}
public SpeedtestHandler(ref Config config, ref V2rayHandler v2rayHandler, List<int> selecteds, string actionType, Action<int, string> update)
public SpeedtestHandler(ref Config config, ref V2rayHandler v2rayHandler, List<VmessItem> selecteds, string actionType, Action<string, string> update)
{
_config = config;
_v2rayHandler = v2rayHandler;
@ -33,11 +33,10 @@ namespace v2rayN.Handler
{
_selecteds.Add(new ServerTestItem()
{
selected = it,
indexId = config.vmess[it].indexId,
address = config.vmess[it].address,
port = config.vmess[it].port,
configType = config.vmess[it].configType
indexId = it.indexId,
address = it.address,
port = it.port,
configType = it.configType
});
}
@ -93,9 +92,8 @@ namespace v2rayN.Handler
RunPingSub((ServerTestItem it) =>
{
long time = Utils.Ping(it.address);
var index = _config.FindIndexId(it.indexId);
if (index < 0) return;
_updateFunc(index, FormatOut(time, "ms"));
_updateFunc(it.indexId, FormatOut(time, "ms"));
});
}
@ -104,9 +102,8 @@ namespace v2rayN.Handler
RunPingSub((ServerTestItem it) =>
{
int time = GetTcpingTime(it.address, it.port);
var index = _config.FindIndexId(it.indexId);
if (index < 0) return;
_updateFunc(index, FormatOut(time, "ms"));
_updateFunc(it.indexId, FormatOut(time, "ms"));
});
}
@ -120,7 +117,7 @@ namespace v2rayN.Handler
pid = _v2rayHandler.LoadV2rayConfigString(_config, _selecteds);
if (pid < 0)
{
_updateFunc(_selecteds[0].selected, UIRes.I18N("OperationFailed"));
_updateFunc(_selecteds[0].indexId, UIRes.I18N("OperationFailed"));
return;
}
@ -144,9 +141,8 @@ namespace v2rayN.Handler
int responseTime = -1;
string status = GetRealPingTime(_config.constItem.speedPingTestUrl, webProxy, out responseTime);
string output = Utils.IsNullOrEmpty(status) ? FormatOut(responseTime, "ms") : status;
var index = _config.FindIndexId(it.indexId);
if (index < 0) return;
_updateFunc(index, output);
_updateFunc(it.indexId, output);
}
catch (Exception ex)
{
@ -203,15 +199,10 @@ namespace v2rayN.Handler
string testIndexId = string.Empty;
int pid = -1;
if (_config.vmess.Count <= 0)
{
return;
}
pid = _v2rayHandler.LoadV2rayConfigString(_config, _selecteds);
if (pid < 0)
{
_updateFunc(_selecteds[0].selected, UIRes.I18N("OperationFailed"));
_updateFunc(_selecteds[0].indexId, UIRes.I18N("OperationFailed"));
return;
}
@ -219,15 +210,11 @@ namespace v2rayN.Handler
DownloadHandle downloadHandle2 = new DownloadHandle();
downloadHandle2.UpdateCompleted += (sender2, args) =>
{
var index = _config.FindIndexId(testIndexId);
if (index < 0) return;
_updateFunc(index, args.Msg);
_updateFunc(testIndexId, args.Msg);
};
downloadHandle2.Error += (sender2, args) =>
{
var index = _config.FindIndexId(testIndexId);
if (index < 0) return;
_updateFunc(index, args.GetException().Message);
_updateFunc(testIndexId, args.GetException().Message);
};
var timeout = 10;
@ -243,7 +230,7 @@ namespace v2rayN.Handler
}
testIndexId = it.indexId;
if (_config.FindIndexId(it.indexId) < 0) continue;
WebProxy webProxy = new WebProxy(Global.Loopback, it.port);
var ws = downloadHandle2.DownloadDataAsync(url, webProxy, timeout - 2);

View File

@ -116,7 +116,7 @@ namespace v2rayN.Handler
if (res != null)
{
string itemId = config_.getItemId();
string itemId = config_.indexId;
ServerStatItem serverStatItem = GetServerStatItem(itemId);
//TODO: parse output

View File

@ -180,6 +180,7 @@ namespace v2rayN.Handler
string id = config.subItem[k - 1].id.Trim();
string url = config.subItem[k - 1].url.Trim();
string userAgent = config.subItem[k - 1].userAgent.Trim();
string groupId = config.subItem[k - 1].groupId.Trim();
string hashCode = $"{k}->";
if (config.subItem[k - 1].enabled == false)
{
@ -207,7 +208,7 @@ namespace v2rayN.Handler
//ConfigHandler.RemoveServerViaSubid(ref config, id);
//_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}");
// RefreshServers();
int ret = MainFormHandler.Instance.AddBatchServers(config, result, id);
int ret = MainFormHandler.Instance.AddBatchServers(config, result, id, groupId);
if (ret > 0)
{
// RefreshServers();

View File

@ -4,6 +4,7 @@ using System.IO;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
@ -21,29 +22,24 @@ namespace v2rayN.Handler
/// <summary>
/// 生成v2ray的客户端配置文件
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static int GenerateClientConfig(Config config, string fileName, bool blExport, out string msg)
public static int GenerateClientConfig(VmessItem node, string fileName, bool blExport, out string msg)
{
try
{
//检查GUI设置
if (config == null
|| config.index < 0
|| config.vmess.Count <= 0
|| config.index > config.vmess.Count - 1
)
if (node == null)
{
msg = UIRes.I18N("CheckServerSettings");
return -1;
}
msg = UIRes.I18N("InitialConfiguration");
if (config.configType() == (int)EConfigType.Custom)
if (node.configType == (int)EConfigType.Custom)
{
return GenerateClientCustomConfig(config, fileName, out msg);
return GenerateClientCustomConfig(node, fileName, out msg);
}
//取得默认配置
@ -62,6 +58,8 @@ namespace v2rayN.Handler
return -1;
}
var config = LazyConfig.Instance.GetConfig();
//开始修改配置
log(config, ref v2rayConfig, blExport);
@ -72,7 +70,7 @@ namespace v2rayN.Handler
routing(config, ref v2rayConfig);
//outbound
outbound(config, ref v2rayConfig);
outbound(node, ref v2rayConfig);
//dns
dns(config, ref v2rayConfig);
@ -82,7 +80,7 @@ namespace v2rayN.Handler
Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), $"[{config.GetGroupRemarks(node.groupId)}] {node.getSummary()}");
}
catch
{
@ -327,15 +325,16 @@ namespace v2rayN.Handler
/// <summary>
/// vmess协议服务器配置
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="v2rayConfig"></param>
/// <returns></returns>
private static int outbound(Config config, ref V2rayConfig v2rayConfig)
private static int outbound(VmessItem node, ref V2rayConfig v2rayConfig)
{
try
{
var config = LazyConfig.Instance.GetConfig();
Outbounds outbound = v2rayConfig.outbounds[0];
if (config.configType() == (int)EConfigType.Vmess)
if (node.configType == (int)EConfigType.Vmess)
{
VnextItem vnextItem;
if (outbound.settings.vnext.Count <= 0)
@ -348,8 +347,8 @@ namespace v2rayN.Handler
vnextItem = outbound.settings.vnext[0];
}
//远程服务器地址和端口
vnextItem.address = config.address();
vnextItem.port = config.port();
vnextItem.address = node.address;
vnextItem.port = node.port;
UsersItem usersItem;
if (vnextItem.users.Count <= 0)
@ -362,12 +361,12 @@ namespace v2rayN.Handler
usersItem = vnextItem.users[0];
}
//远程服务器用户ID
usersItem.id = config.id();
usersItem.alterId = config.alterId();
usersItem.id = node.id;
usersItem.alterId = node.alterId;
usersItem.email = Global.userEMail;
if (Global.vmessSecuritys.Contains(config.security()))
if (Global.vmessSecuritys.Contains(node.security))
{
usersItem.security = config.security();
usersItem.security = node.security;
}
else
{
@ -380,12 +379,12 @@ namespace v2rayN.Handler
//远程服务器底层传输配置
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(config, "out", ref streamSettings);
boundStreamSettings(node, "out", ref streamSettings);
outbound.protocol = Global.vmessProtocolLite;
outbound.settings.servers = null;
}
else if (config.configType() == (int)EConfigType.Shadowsocks)
else if (node.configType == (int)EConfigType.Shadowsocks)
{
ServersItem serversItem;
if (outbound.settings.servers.Count <= 0)
@ -398,12 +397,12 @@ namespace v2rayN.Handler
serversItem = outbound.settings.servers[0];
}
//远程服务器地址和端口
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.password = config.id();
if (config.GetShadowsocksSecuritys().Contains(config.security()))
serversItem.address = node.address;
serversItem.port = node.port;
serversItem.password = node.id;
if (config.GetShadowsocksSecuritys().Contains(node.security))
{
serversItem.method = config.security();
serversItem.method = node.security;
}
else
{
@ -421,7 +420,7 @@ namespace v2rayN.Handler
outbound.protocol = Global.ssProtocolLite;
outbound.settings.vnext = null;
}
else if (config.configType() == (int)EConfigType.Socks)
else if (node.configType == (int)EConfigType.Socks)
{
ServersItem serversItem;
if (outbound.settings.servers.Count <= 0)
@ -434,18 +433,18 @@ namespace v2rayN.Handler
serversItem = outbound.settings.servers[0];
}
//远程服务器地址和端口
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.address = node.address;
serversItem.port = node.port;
serversItem.method = null;
serversItem.password = null;
if (!Utils.IsNullOrEmpty(config.security())
&& !Utils.IsNullOrEmpty(config.id()))
if (!Utils.IsNullOrEmpty(node.security)
&& !Utils.IsNullOrEmpty(node.id))
{
SocksUsersItem socksUsersItem = new SocksUsersItem
{
user = config.security(),
pass = config.id(),
user = node.security,
pass = node.id,
level = 1
};
@ -458,7 +457,7 @@ namespace v2rayN.Handler
outbound.protocol = Global.socksProtocolLite;
outbound.settings.vnext = null;
}
else if (config.configType() == (int)EConfigType.VLESS)
else if (node.configType == (int)EConfigType.VLESS)
{
VnextItem vnextItem;
if (outbound.settings.vnext.Count <= 0)
@ -471,8 +470,8 @@ namespace v2rayN.Handler
vnextItem = outbound.settings.vnext[0];
}
//远程服务器地址和端口
vnextItem.address = config.address();
vnextItem.port = config.port();
vnextItem.address = node.address;
vnextItem.port = node.port;
UsersItem usersItem;
if (vnextItem.users.Count <= 0)
@ -485,10 +484,10 @@ namespace v2rayN.Handler
usersItem = vnextItem.users[0];
}
//远程服务器用户ID
usersItem.id = config.id();
usersItem.id = node.id;
usersItem.flow = string.Empty;
usersItem.email = Global.userEMail;
usersItem.encryption = config.security();
usersItem.encryption = node.security;
//Mux
outbound.mux.enabled = config.muxEnabled;
@ -496,18 +495,18 @@ namespace v2rayN.Handler
//远程服务器底层传输配置
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(config, "out", ref streamSettings);
boundStreamSettings(node, "out", ref streamSettings);
//if xtls
if (config.streamSecurity() == Global.StreamSecurityX)
if (node.streamSecurity == Global.StreamSecurityX)
{
if (Utils.IsNullOrEmpty(config.flow()))
if (Utils.IsNullOrEmpty(node.flow))
{
usersItem.flow = Global.xtlsFlows[1];
}
else
{
usersItem.flow = config.flow().Replace("splice", "direct");
usersItem.flow = node.flow.Replace("splice", "direct");
}
outbound.mux.enabled = false;
@ -517,7 +516,7 @@ namespace v2rayN.Handler
outbound.protocol = Global.vlessProtocolLite;
outbound.settings.servers = null;
}
else if (config.configType() == (int)EConfigType.Trojan)
else if (node.configType == (int)EConfigType.Trojan)
{
ServersItem serversItem;
if (outbound.settings.servers.Count <= 0)
@ -530,24 +529,24 @@ namespace v2rayN.Handler
serversItem = outbound.settings.servers[0];
}
//远程服务器地址和端口
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.password = config.id();
serversItem.address = node.address;
serversItem.port = node.port;
serversItem.password = node.id;
serversItem.flow = string.Empty;
serversItem.ota = false;
serversItem.level = 1;
//if xtls
if (config.streamSecurity() == Global.StreamSecurityX)
if (node.streamSecurity == Global.StreamSecurityX)
{
if (Utils.IsNullOrEmpty(config.flow()))
if (Utils.IsNullOrEmpty(node.flow))
{
serversItem.flow = Global.xtlsFlows[1];
}
else
{
serversItem.flow = config.flow().Replace("splice", "direct");
serversItem.flow = node.flow.Replace("splice", "direct");
}
outbound.mux.enabled = false;
@ -560,7 +559,7 @@ namespace v2rayN.Handler
//远程服务器底层传输配置
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(config, "out", ref streamSettings);
boundStreamSettings(node, "out", ref streamSettings);
outbound.protocol = Global.trojanProtocolLite;
outbound.settings.vnext = null;
@ -575,28 +574,29 @@ namespace v2rayN.Handler
/// <summary>
/// vmess协议远程服务器底层传输配置
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="iobound"></param>
/// <param name="streamSettings"></param>
/// <returns></returns>
private static int boundStreamSettings(Config config, string iobound, ref StreamSettings streamSettings)
private static int boundStreamSettings(VmessItem node, string iobound, ref StreamSettings streamSettings)
{
try
{
var config = LazyConfig.Instance.GetConfig();
//远程服务器底层传输配置
streamSettings.network = config.network();
string host = config.requestHost();
string sni = config.sni();
streamSettings.network = node.getNetwork();
string host = node.requestHost.TrimEx();
string sni = node.sni;
//if tls
if (config.streamSecurity() == Global.StreamSecurity)
if (node.streamSecurity == Global.StreamSecurity)
{
streamSettings.security = config.streamSecurity();
streamSettings.security = node.streamSecurity;
TlsSettings tlsSettings = new TlsSettings
{
allowInsecure = config.allowInsecure(),
alpn = config.alpn()
allowInsecure = Utils.ToBool(node.allowInsecure),
alpn = node.getAlpn()
};
if (!string.IsNullOrWhiteSpace(sni))
{
@ -610,14 +610,14 @@ namespace v2rayN.Handler
}
//if xtls
if (config.streamSecurity() == Global.StreamSecurityX)
if (node.streamSecurity == Global.StreamSecurityX)
{
streamSettings.security = config.streamSecurity();
streamSettings.security = node.streamSecurity;
TlsSettings xtlsSettings = new TlsSettings
{
allowInsecure = config.allowInsecure(),
alpn = config.alpn()
allowInsecure = Utils.ToBool(node.allowInsecure),
alpn = node.getAlpn()
};
if (!string.IsNullOrWhiteSpace(sni))
{
@ -631,7 +631,7 @@ namespace v2rayN.Handler
}
//streamSettings
switch (config.network())
switch (node.getNetwork())
{
//kcp基本配置暂时是默认值用户能自己设置伪装类型
case "kcp":
@ -661,11 +661,11 @@ namespace v2rayN.Handler
kcpSettings.writeBufferSize = config.kcpItem.writeBufferSize;
kcpSettings.header = new Header
{
type = config.headerType()
type = node.headerType
};
if (!Utils.IsNullOrEmpty(config.path()))
if (!Utils.IsNullOrEmpty(node.path))
{
kcpSettings.seed = config.path();
kcpSettings.seed = node.path;
}
streamSettings.kcpSettings = kcpSettings;
break;
@ -675,7 +675,7 @@ namespace v2rayN.Handler
{
};
string path = config.path();
string path = node.path;
if (!string.IsNullOrWhiteSpace(host))
{
wsSettings.headers = new Headers
@ -705,7 +705,7 @@ namespace v2rayN.Handler
{
httpSettings.host = Utils.String2List(host);
}
httpSettings.path = config.path();
httpSettings.path = node.path;
streamSettings.httpSettings = httpSettings;
@ -718,14 +718,14 @@ namespace v2rayN.Handler
QuicSettings quicsettings = new QuicSettings
{
security = host,
key = config.path(),
key = node.path,
header = new Header
{
type = config.headerType()
type = node.headerType
}
};
streamSettings.quicSettings = quicsettings;
if (config.streamSecurity() == Global.StreamSecurity)
if (node.streamSecurity == Global.StreamSecurity)
{
if (!string.IsNullOrWhiteSpace(sni))
{
@ -733,26 +733,26 @@ namespace v2rayN.Handler
}
else
{
streamSettings.tlsSettings.serverName = config.address();
streamSettings.tlsSettings.serverName = node.address;
}
}
break;
case "grpc":
var grpcSettings = new GrpcSettings();
grpcSettings.serviceName = config.path();
grpcSettings.multiMode = (config.headerType() == Global.GrpcmultiMode ? true : false);
grpcSettings.serviceName = node.path;
grpcSettings.multiMode = (node.headerType == Global.GrpcmultiMode ? true : false);
streamSettings.grpcSettings = grpcSettings;
break;
default:
//tcp带http伪装
if (config.headerType().Equals(Global.TcpHeaderHttp))
if (node.headerType.Equals(Global.TcpHeaderHttp))
{
TcpSettings tcpSettings = new TcpSettings
{
header = new Header
{
type = config.headerType()
type = node.headerType
}
};
@ -767,9 +767,9 @@ namespace v2rayN.Handler
//填入自定义Path
string pathHttp = @"/";
if (!Utils.IsNullOrEmpty(config.path()))
if (!Utils.IsNullOrEmpty(node.path))
{
string[] arrPath = config.path().Split(',');
string[] arrPath = node.path.Split(',');
pathHttp = string.Join("\",\"", arrPath);
}
request = request.Replace("$requestPath$", string.Format("\"{0}\"", pathHttp));
@ -837,7 +837,7 @@ namespace v2rayN.Handler
return 0;
}
public static int statistic(Config config, ref V2rayConfig v2rayConfig)
private static int statistic(Config config, ref V2rayConfig v2rayConfig)
{
if (config.enableStatistics)
{
@ -889,20 +889,16 @@ namespace v2rayN.Handler
/// <summary>
/// 生成v2ray的客户端配置文件(自定义配置)
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static int GenerateClientCustomConfig(Config config, string fileName, out string msg)
private static int GenerateClientCustomConfig(VmessItem node, string fileName, out string msg)
{
try
{
//检查GUI设置
if (config == null
|| config.index < 0
|| config.vmess.Count <= 0
|| config.index > config.vmess.Count - 1
)
if (node == null)
{
msg = UIRes.I18N("CheckServerSettings");
return -1;
@ -913,7 +909,7 @@ namespace v2rayN.Handler
File.Delete(fileName);
}
string addressFileName = config.address();
string addressFileName = node.address;
if (!File.Exists(addressFileName))
{
addressFileName = Path.Combine(Utils.GetTempPath(), addressFileName);
@ -925,7 +921,7 @@ namespace v2rayN.Handler
}
File.Copy(addressFileName, fileName);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), $"[{LazyConfig.Instance.GetConfig().GetGroupRemarks(node.groupId)}] {node.getSummary()}");
}
catch
{
@ -942,20 +938,16 @@ namespace v2rayN.Handler
/// <summary>
/// 生成v2ray的客户端配置文件
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static int GenerateServerConfig(Config config, string fileName, out string msg)
public static int GenerateServerConfig(VmessItem node, string fileName, out string msg)
{
try
{
//检查GUI设置
if (config == null
|| config.index < 0
|| config.vmess.Count <= 0
|| config.index > config.vmess.Count - 1
)
if (node == null)
{
msg = UIRes.I18N("CheckServerSettings");
return -1;
@ -979,18 +971,20 @@ namespace v2rayN.Handler
return -1;
}
var config = LazyConfig.Instance.GetConfig();
////开始修改配置
log(config, ref v2rayConfig, true);
//vmess协议服务器配置
ServerInbound(config, ref v2rayConfig);
ServerInbound(node, ref v2rayConfig);
//传出设置
ServerOutbound(config, ref v2rayConfig);
Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), node.getSummary());
}
catch
{
@ -1003,10 +997,10 @@ namespace v2rayN.Handler
/// <summary>
/// vmess协议服务器配置
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="v2rayConfig"></param>
/// <returns></returns>
private static int ServerInbound(Config config, ref V2rayConfig v2rayConfig)
private static int ServerInbound(VmessItem node, ref V2rayConfig v2rayConfig)
{
try
{
@ -1022,28 +1016,28 @@ namespace v2rayN.Handler
usersItem = inbound.settings.clients[0];
}
//远程服务器端口
inbound.port = config.port();
inbound.port = node.port;
//远程服务器用户ID
usersItem.id = config.id();
usersItem.id = node.id;
usersItem.email = Global.userEMail;
if (config.configType() == (int)EConfigType.Vmess)
if (node.configType == (int)EConfigType.Vmess)
{
inbound.protocol = Global.vmessProtocolLite;
usersItem.alterId = config.alterId();
usersItem.alterId = node.alterId;
}
else if (config.configType() == (int)EConfigType.VLESS)
else if (node.configType == (int)EConfigType.VLESS)
{
inbound.protocol = Global.vlessProtocolLite;
usersItem.flow = config.flow();
inbound.settings.decryption = config.security();
usersItem.flow = node.flow;
inbound.settings.decryption = node.security;
}
//远程服务器底层传输配置
StreamSettings streamSettings = inbound.streamSettings;
boundStreamSettings(config, "in", ref streamSettings);
boundStreamSettings(node, "in", ref streamSettings);
}
catch
{
@ -1054,7 +1048,7 @@ namespace v2rayN.Handler
/// <summary>
/// 传出设置
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="v2rayConfig"></param>
/// <returns></returns>
private static int ServerOutbound(Config config, ref V2rayConfig v2rayConfig)
@ -1368,25 +1362,25 @@ namespace v2rayN.Handler
/// <summary>
/// 导出为客户端配置
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static int Export2ClientConfig(Config config, string fileName, out string msg)
public static int Export2ClientConfig(VmessItem node, string fileName, out string msg)
{
return GenerateClientConfig(config, fileName, true, out msg);
return GenerateClientConfig(node, fileName, true, out msg);
}
/// <summary>
/// 导出为服务端配置
/// </summary>
/// <param name="config"></param>
/// <param name="node"></param>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static int Export2ServerConfig(Config config, string fileName, out string msg)
public static int Export2ServerConfig(VmessItem node, string fileName, out string msg)
{
return GenerateServerConfig(config, fileName, out msg);
return GenerateServerConfig(node, fileName, out msg);
}
#endregion
@ -1398,11 +1392,7 @@ namespace v2rayN.Handler
{
try
{
if (config == null
|| config.index < 0
|| config.vmess.Count <= 0
|| config.index > config.vmess.Count - 1
)
if (config == null)
{
msg = UIRes.I18N("CheckServerSettings");
return "";
@ -1470,7 +1460,6 @@ namespace v2rayN.Handler
{
continue;
}
configCopy.index = it.selected;
it.port = port;
Inbounds inbound = new Inbounds
@ -1482,9 +1471,9 @@ namespace v2rayN.Handler
inbound.tag = Global.InboundHttp + inbound.port.ToString();
v2rayConfig.inbounds.Add(inbound);
var index = configCopy.FindIndexId(it.indexId);
V2rayConfig v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result);
outbound(configCopy, ref v2rayConfigCopy);
outbound(configCopy.vmess[index], ref v2rayConfigCopy);
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]);
@ -1497,7 +1486,7 @@ namespace v2rayN.Handler
v2rayConfig.routing.rules.Add(rule);
}
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), configCopy.getSummary());
//msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), node.getSummary());
return Utils.ToJson(v2rayConfig);
}
catch

View File

@ -56,8 +56,9 @@ namespace v2rayN.Handler
if (Global.reloadV2ray)
{
var item = ConfigHandler.GetDefaultServer(ref config);
string fileName = Utils.GetPath(v2rayConfigRes);
if (V2rayConfigHandler.GenerateClientConfig(config, fileName, false, out string msg) != 0)
if (V2rayConfigHandler.GenerateClientConfig(item, fileName, false, out string msg) != 0)
{
ShowMsg(false, msg);
}

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using System.Linq;
namespace v2rayN.Mode
@ -30,10 +31,7 @@ namespace v2rayN.Mode
get; set;
}
/// <summary>
/// 活动配置序号
/// </summary>
public int index
public string indexId
{
get; set;
}
@ -206,111 +204,13 @@ namespace v2rayN.Mode
get; set;
}
public List<GroupItem> groupItem
{
get; set;
}
#endregion
#region function
public string address()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].address.TrimEx();
}
public int port()
{
if (index < 0)
{
return 10808;
}
return vmess[index].port;
}
public string id()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].id.TrimEx();
}
public int alterId()
{
if (index < 0)
{
return 0;
}
return vmess[index].alterId;
}
public string security()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].security.TrimEx();
}
public string remarks()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].remarks.TrimEx();
}
public string network()
{
if (index < 0 || Utils.IsNullOrEmpty(vmess[index].network) || !Global.networks.Contains(vmess[index].network))
{
return Global.DefaultNetwork;
}
return vmess[index].network.TrimEx();
}
public string headerType()
{
if (index < 0 || Utils.IsNullOrEmpty(vmess[index].headerType))
{
return Global.None;
}
return vmess[index].headerType.Replace(" ", "").TrimEx();
}
public string requestHost()
{
if (index < 0 || Utils.IsNullOrEmpty(vmess[index].requestHost))
{
return string.Empty;
}
return vmess[index].requestHost.Replace(" ", "").TrimEx();
}
public string path()
{
if (index < 0 || Utils.IsNullOrEmpty(vmess[index].path))
{
return string.Empty;
}
return vmess[index].path.Replace(" ", "").TrimEx();
}
public string streamSecurity()
{
if (index < 0 || Utils.IsNullOrEmpty(vmess[index].streamSecurity))
{
return string.Empty;
}
return vmess[index].streamSecurity;
}
public bool allowInsecure()
{
if (index < 0 || Utils.IsNullOrEmpty(vmess[index].allowInsecure))
{
return defAllowInsecure;
}
return Convert.ToBoolean(vmess[index].allowInsecure);
}
#region function
public int GetLocalPort(string protocol)
{
@ -336,79 +236,13 @@ namespace v2rayN.Mode
return localPort;
}
public int configType()
public int FindIndexId(string id)
{
if (index < 0)
{
return 0;
}
return vmess[index].configType;
}
public string getSummary()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].getSummary();
}
public string getItemId()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].getItemId();
}
public string flow()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].flow.TrimEx();
}
public string sni()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].sni.TrimEx();
}
public List<string> alpn()
{
if (index < 0)
{
return null;
}
if (vmess[index].alpn != null && vmess[index].alpn.Count > 0)
{
return vmess[index].alpn;
}
else
{
return null;
}
}
public string indexId()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].indexId.TrimEx();
}
public int FindIndexId(string indexId)
{
if (string.IsNullOrEmpty(indexId))
if (string.IsNullOrEmpty(id))
{
return -1;
}
return vmess.FindIndex(it => it.indexId == indexId);
return vmess.FindIndex(it => it.indexId == id);
}
public List<string> GetShadowsocksSecuritys()
@ -420,7 +254,26 @@ namespace v2rayN.Mode
return Global.ssSecuritysInXray;
}
public bool IsActiveNode(VmessItem item)
{
if (!Utils.IsNullOrEmpty(item.indexId) && item.indexId == indexId)
{
return true;
}
return false;
}
public string GetGroupRemarks(string groupId)
{
if (string.IsNullOrEmpty(groupId))
{
return string.Empty;
}
return groupItem.Where(it => it.id == groupId).FirstOrDefault()?.remarks;
}
#endregion
}
@ -431,7 +284,9 @@ namespace v2rayN.Mode
public VmessItem()
{
indexId = string.Empty;
configVersion = 1;
configType = (int)EConfigType.Vmess;
configVersion = 2;
sort = 0;
address = string.Empty;
port = 0;
id = string.Empty;
@ -444,12 +299,13 @@ namespace v2rayN.Mode
path = string.Empty;
streamSecurity = string.Empty;
allowInsecure = string.Empty;
configType = (int)EConfigType.Vmess;
testResult = string.Empty;
subid = string.Empty;
flow = string.Empty;
groupId = string.Empty;
}
#region function
public string getSummary()
{
string summary = string.Format("[{0}] ", ((EConfigType)configType).ToString());
@ -470,23 +326,33 @@ namespace v2rayN.Mode
switch (configType)
{
case (int)EConfigType.Vmess:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.Shadowsocks:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.Socks:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.VLESS:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.Trojan:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
default:
summary += string.Format("{0}", remarks);
break;
//case (int)EConfigType.Vmess:
// summary += string.Format("{0}({1}:{2})", remarks, addr, port);
// break;
//case (int)EConfigType.Shadowsocks:
// summary += string.Format("{0}({1}:{2})", remarks, addr, port);
// break;
//case (int)EConfigType.Socks:
// summary += string.Format("{0}({1}:{2})", remarks, addr, port);
// break;
//case (int)EConfigType.VLESS:
// summary += string.Format("{0}({1}:{2})", remarks, addr, port);
// break;
//case (int)EConfigType.Trojan:
// summary += string.Format("{0}({1}:{2})", remarks, addr, port);
// break;
//default:
// summary += string.Format("{0}", remarks);
// break;
}
return summary;
}
@ -511,17 +377,40 @@ namespace v2rayN.Mode
return subid.Substring(0, 4);
}
public string getItemId()
public List<string> getAlpn()
{
string itemId = $"{address}{port}{requestHost}{path}";
itemId = Utils.Base64Encode(itemId);
return itemId;
if (alpn != null && alpn.Count > 0)
{
return alpn;
}
else
{
return null;
}
}
public string getNetwork()
{
if (Utils.IsNullOrEmpty(network) || !Global.networks.Contains(network))
{
return Global.DefaultNetwork;
}
return network.TrimEx();
}
#endregion
public string indexId
{
get; set;
}
/// <summary>
/// config type(1=normal,2=custom)
/// </summary>
public int configType
{
get; set;
}
/// <summary>
/// 版本(现在=2)
/// </summary>
@ -530,6 +419,11 @@ namespace v2rayN.Mode
get; set;
}
public int sort
{
get; set;
}
/// <summary>
/// 远程服务器地址
/// </summary>
@ -620,15 +514,6 @@ namespace v2rayN.Mode
get; set;
}
/// <summary>
/// config type(1=normal,2=custom)
/// </summary>
public int configType
{
get; set;
}
/// <summary>
///
/// </summary>
@ -666,6 +551,11 @@ namespace v2rayN.Mode
{
get; set;
}
public string groupId
{
get; set;
}
}
[Serializable]
@ -795,6 +685,11 @@ namespace v2rayN.Mode
{
get; set;
} = string.Empty;
public string groupId
{
get; set;
}
}
[Serializable]
@ -853,4 +748,24 @@ namespace v2rayN.Mode
public Keys? KeyCode { get; set; }
}
[Serializable]
public class GroupItem
{
/// <summary>
///
/// </summary>
public string id
{
get; set;
}
/// <summary>
///
/// </summary>
public string remarks
{
get; set;
}
}
}

View File

@ -5,10 +5,6 @@ namespace v2rayN.Mode
[Serializable]
class ServerTestItem
{
public int selected
{
get; set;
}
public string indexId
{
get; set;

View File

@ -1041,5 +1041,14 @@ namespace v2rayN.Resx {
return ResourceManager.GetString("TransportRequestHostTip4", resourceCulture);
}
}
/// <summary>
/// 查找类似 Ungrouped 的本地化字符串。
/// </summary>
internal static string UngroupedServers {
get {
return ResourceManager.GetString("UngroupedServers", resourceCulture);
}
}
}
}

View File

@ -445,4 +445,7 @@
<data name="RegisterGlobalHotkeySuccessfully" xml:space="preserve">
<value>Global hotkey {0} registered successfully</value>
</data>
<data name="UngroupedServers" xml:space="preserve">
<value>Ungrouped</value>
</data>
</root>

View File

@ -445,4 +445,7 @@
<data name="RegisterGlobalHotkeySuccessfully" xml:space="preserve">
<value>注册全局热键 {0} 成功</value>
</data>
<data name="UngroupedServers" xml:space="preserve">
<value>未分组服务器</value>
</data>
</root>

View File

@ -18,7 +18,7 @@
"network": "tcp"
}
}],
"outbound": [{
"outbounds": [{
"protocol": "freedom",
"settings": {}
}, {

View File

@ -284,6 +284,18 @@ namespace v2rayN
return 0;
}
}
public static bool ToBool(object obj)
{
try
{
return Convert.ToBoolean(obj);
}
catch (Exception ex)
{
SaveLog(ex.Message, ex);
return false;
}
}
public static string ToString(object obj)
{

View File

@ -85,6 +85,7 @@
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
@ -155,6 +156,18 @@
<Compile Include="Forms\ServerTransportControl.Designer.cs">
<DependentUpon>ServerTransportControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\GroupSettingControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\GroupSettingControl.Designer.cs">
<DependentUpon>GroupSettingControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\GroupSettingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\GroupSettingForm.Designer.cs">
<DependentUpon>GroupSettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Handler\LazyConfig.cs" />
<Compile Include="Handler\ShareHandler.cs" />
<Compile Include="Handler\UpdateHandle.cs" />
@ -364,6 +377,14 @@
<EmbeddedResource Include="Forms\ServerTransportControl.zh-Hans.resx">
<DependentUpon>ServerTransportControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingControl.resx">
<DependentUpon>GroupSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingControl.zh-Hans.resx">
<DependentUpon>GroupSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingControl.resx">
<DependentUpon>SubSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
@ -378,6 +399,13 @@
<EmbeddedResource Include="Forms\RoutingSettingForm.zh-Hans.resx">
<DependentUpon>RoutingSettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingForm.resx">
<DependentUpon>GroupSettingForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingForm.zh-Hans.resx">
<DependentUpon>GroupSettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingForm.resx">
<DependentUpon>SubSettingForm.cs</DependentUpon>
<SubType>Designer</SubType>