mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-03 05:38:51 +00:00
Routing rule add custom icon
This commit is contained in:
parent
c29ccf76d5
commit
1138d660b2
6 changed files with 716 additions and 530 deletions
|
@ -34,6 +34,10 @@
|
||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
this.btnOK = new System.Windows.Forms.Button();
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.btnBrowse = new System.Windows.Forms.Button();
|
||||||
|
this.txtCustomIcon = new System.Windows.Forms.TextBox();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.txtUrl = new System.Windows.Forms.TextBox();
|
this.txtUrl = new System.Windows.Forms.TextBox();
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
@ -68,17 +72,17 @@
|
||||||
//
|
//
|
||||||
// btnClose
|
// btnClose
|
||||||
//
|
//
|
||||||
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
|
||||||
resources.ApplyResources(this.btnClose, "btnClose");
|
resources.ApplyResources(this.btnClose, "btnClose");
|
||||||
|
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
this.btnClose.Name = "btnClose";
|
this.btnClose.Name = "btnClose";
|
||||||
this.btnClose.UseVisualStyleBackColor = true;
|
this.btnClose.UseVisualStyleBackColor = true;
|
||||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||||
//
|
//
|
||||||
// panel2
|
// panel2
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.panel2, "panel2");
|
||||||
this.panel2.Controls.Add(this.btnClose);
|
this.panel2.Controls.Add(this.btnClose);
|
||||||
this.panel2.Controls.Add(this.btnOK);
|
this.panel2.Controls.Add(this.btnOK);
|
||||||
resources.ApplyResources(this.panel2, "panel2");
|
|
||||||
this.panel2.Name = "panel2";
|
this.panel2.Name = "panel2";
|
||||||
//
|
//
|
||||||
// btnOK
|
// btnOK
|
||||||
|
@ -90,14 +94,40 @@
|
||||||
//
|
//
|
||||||
// panel1
|
// panel1
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.panel1, "panel1");
|
||||||
|
this.panel1.Controls.Add(this.label5);
|
||||||
|
this.panel1.Controls.Add(this.btnBrowse);
|
||||||
|
this.panel1.Controls.Add(this.txtCustomIcon);
|
||||||
|
this.panel1.Controls.Add(this.label4);
|
||||||
this.panel1.Controls.Add(this.label1);
|
this.panel1.Controls.Add(this.label1);
|
||||||
this.panel1.Controls.Add(this.txtUrl);
|
this.panel1.Controls.Add(this.txtUrl);
|
||||||
this.panel1.Controls.Add(this.label3);
|
this.panel1.Controls.Add(this.label3);
|
||||||
this.panel1.Controls.Add(this.txtRemarks);
|
this.panel1.Controls.Add(this.txtRemarks);
|
||||||
this.panel1.Controls.Add(this.label2);
|
this.panel1.Controls.Add(this.label2);
|
||||||
resources.ApplyResources(this.panel1, "panel1");
|
|
||||||
this.panel1.Name = "panel1";
|
this.panel1.Name = "panel1";
|
||||||
//
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.label5, "label5");
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
//
|
||||||
|
// btnBrowse
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.btnBrowse, "btnBrowse");
|
||||||
|
this.btnBrowse.Name = "btnBrowse";
|
||||||
|
this.btnBrowse.UseVisualStyleBackColor = true;
|
||||||
|
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
|
||||||
|
//
|
||||||
|
// txtCustomIcon
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.txtCustomIcon, "txtCustomIcon");
|
||||||
|
this.txtCustomIcon.Name = "txtCustomIcon";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.label4, "label4");
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.label1, "label1");
|
resources.ApplyResources(this.label1, "label1");
|
||||||
|
@ -125,8 +155,8 @@
|
||||||
//
|
//
|
||||||
// lvRoutings
|
// lvRoutings
|
||||||
//
|
//
|
||||||
this.lvRoutings.ContextMenuStrip = this.cmsLv;
|
|
||||||
resources.ApplyResources(this.lvRoutings, "lvRoutings");
|
resources.ApplyResources(this.lvRoutings, "lvRoutings");
|
||||||
|
this.lvRoutings.ContextMenuStrip = this.cmsLv;
|
||||||
this.lvRoutings.FullRowSelect = true;
|
this.lvRoutings.FullRowSelect = true;
|
||||||
this.lvRoutings.GridLines = true;
|
this.lvRoutings.GridLines = true;
|
||||||
this.lvRoutings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
this.lvRoutings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||||
|
@ -142,6 +172,7 @@
|
||||||
//
|
//
|
||||||
// cmsLv
|
// cmsLv
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.cmsLv, "cmsLv");
|
||||||
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
|
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||||
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.menuAdd,
|
this.menuAdd,
|
||||||
|
@ -155,114 +186,113 @@
|
||||||
this.menuMoveBottom});
|
this.menuMoveBottom});
|
||||||
this.cmsLv.Name = "cmsLv";
|
this.cmsLv.Name = "cmsLv";
|
||||||
this.cmsLv.OwnerItem = this.MenuItem1;
|
this.cmsLv.OwnerItem = this.MenuItem1;
|
||||||
resources.ApplyResources(this.cmsLv, "cmsLv");
|
|
||||||
//
|
//
|
||||||
// menuAdd
|
// menuAdd
|
||||||
//
|
//
|
||||||
this.menuAdd.Name = "menuAdd";
|
|
||||||
resources.ApplyResources(this.menuAdd, "menuAdd");
|
resources.ApplyResources(this.menuAdd, "menuAdd");
|
||||||
|
this.menuAdd.Name = "menuAdd";
|
||||||
this.menuAdd.Click += new System.EventHandler(this.menuAdd_Click);
|
this.menuAdd.Click += new System.EventHandler(this.menuAdd_Click);
|
||||||
//
|
//
|
||||||
// menuRemove
|
// menuRemove
|
||||||
//
|
//
|
||||||
this.menuRemove.Name = "menuRemove";
|
|
||||||
resources.ApplyResources(this.menuRemove, "menuRemove");
|
resources.ApplyResources(this.menuRemove, "menuRemove");
|
||||||
|
this.menuRemove.Name = "menuRemove";
|
||||||
this.menuRemove.Click += new System.EventHandler(this.menuRemove_Click);
|
this.menuRemove.Click += new System.EventHandler(this.menuRemove_Click);
|
||||||
//
|
//
|
||||||
// menuSelectAll
|
// menuSelectAll
|
||||||
//
|
//
|
||||||
this.menuSelectAll.Name = "menuSelectAll";
|
|
||||||
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
|
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
|
||||||
|
this.menuSelectAll.Name = "menuSelectAll";
|
||||||
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
|
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
|
||||||
//
|
//
|
||||||
// menuExportSelectedRules
|
// menuExportSelectedRules
|
||||||
//
|
//
|
||||||
this.menuExportSelectedRules.Name = "menuExportSelectedRules";
|
|
||||||
resources.ApplyResources(this.menuExportSelectedRules, "menuExportSelectedRules");
|
resources.ApplyResources(this.menuExportSelectedRules, "menuExportSelectedRules");
|
||||||
|
this.menuExportSelectedRules.Name = "menuExportSelectedRules";
|
||||||
this.menuExportSelectedRules.Click += new System.EventHandler(this.menuExportSelectedRules_Click);
|
this.menuExportSelectedRules.Click += new System.EventHandler(this.menuExportSelectedRules_Click);
|
||||||
//
|
//
|
||||||
// toolStripSeparator3
|
// toolStripSeparator3
|
||||||
//
|
//
|
||||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
|
||||||
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
|
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
|
||||||
|
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||||
//
|
//
|
||||||
// menuMoveTop
|
// menuMoveTop
|
||||||
//
|
//
|
||||||
this.menuMoveTop.Name = "menuMoveTop";
|
|
||||||
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
|
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
|
||||||
|
this.menuMoveTop.Name = "menuMoveTop";
|
||||||
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
|
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
|
||||||
//
|
//
|
||||||
// menuMoveUp
|
// menuMoveUp
|
||||||
//
|
//
|
||||||
this.menuMoveUp.Name = "menuMoveUp";
|
|
||||||
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
|
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
|
||||||
|
this.menuMoveUp.Name = "menuMoveUp";
|
||||||
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
|
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
|
||||||
//
|
//
|
||||||
// menuMoveDown
|
// menuMoveDown
|
||||||
//
|
//
|
||||||
this.menuMoveDown.Name = "menuMoveDown";
|
|
||||||
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
|
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
|
||||||
|
this.menuMoveDown.Name = "menuMoveDown";
|
||||||
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
|
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
|
||||||
//
|
//
|
||||||
// menuMoveBottom
|
// menuMoveBottom
|
||||||
//
|
//
|
||||||
this.menuMoveBottom.Name = "menuMoveBottom";
|
|
||||||
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
|
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
|
||||||
|
this.menuMoveBottom.Name = "menuMoveBottom";
|
||||||
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
|
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
|
||||||
//
|
//
|
||||||
// MenuItem1
|
// MenuItem1
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.MenuItem1, "MenuItem1");
|
||||||
this.MenuItem1.DropDown = this.cmsLv;
|
this.MenuItem1.DropDown = this.cmsLv;
|
||||||
this.MenuItem1.Name = "MenuItem1";
|
this.MenuItem1.Name = "MenuItem1";
|
||||||
resources.ApplyResources(this.MenuItem1, "MenuItem1");
|
|
||||||
//
|
//
|
||||||
// tabControl2
|
// tabControl2
|
||||||
//
|
//
|
||||||
this.tabControl2.Controls.Add(this.tabPage2);
|
|
||||||
resources.ApplyResources(this.tabControl2, "tabControl2");
|
resources.ApplyResources(this.tabControl2, "tabControl2");
|
||||||
|
this.tabControl2.Controls.Add(this.tabPage2);
|
||||||
this.tabControl2.Name = "tabControl2";
|
this.tabControl2.Name = "tabControl2";
|
||||||
this.tabControl2.SelectedIndex = 0;
|
this.tabControl2.SelectedIndex = 0;
|
||||||
//
|
//
|
||||||
// tabPage2
|
// tabPage2
|
||||||
//
|
//
|
||||||
this.tabPage2.Controls.Add(this.lvRoutings);
|
|
||||||
resources.ApplyResources(this.tabPage2, "tabPage2");
|
resources.ApplyResources(this.tabPage2, "tabPage2");
|
||||||
|
this.tabPage2.Controls.Add(this.lvRoutings);
|
||||||
this.tabPage2.Name = "tabPage2";
|
this.tabPage2.Name = "tabPage2";
|
||||||
this.tabPage2.UseVisualStyleBackColor = true;
|
this.tabPage2.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// menuServer
|
// menuServer
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.menuServer, "menuServer");
|
||||||
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.MenuItem1,
|
this.MenuItem1,
|
||||||
this.toolStripMenuItem1});
|
this.toolStripMenuItem1});
|
||||||
resources.ApplyResources(this.menuServer, "menuServer");
|
|
||||||
this.menuServer.Name = "menuServer";
|
this.menuServer.Name = "menuServer";
|
||||||
//
|
//
|
||||||
// toolStripMenuItem1
|
// toolStripMenuItem1
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1");
|
||||||
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.menuImportRulesFromFile,
|
this.menuImportRulesFromFile,
|
||||||
this.menuImportRulesFromClipboard,
|
this.menuImportRulesFromClipboard,
|
||||||
this.menuImportRulesFromUrl});
|
this.menuImportRulesFromUrl});
|
||||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||||
resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1");
|
|
||||||
//
|
//
|
||||||
// menuImportRulesFromFile
|
// menuImportRulesFromFile
|
||||||
//
|
//
|
||||||
this.menuImportRulesFromFile.Name = "menuImportRulesFromFile";
|
|
||||||
resources.ApplyResources(this.menuImportRulesFromFile, "menuImportRulesFromFile");
|
resources.ApplyResources(this.menuImportRulesFromFile, "menuImportRulesFromFile");
|
||||||
|
this.menuImportRulesFromFile.Name = "menuImportRulesFromFile";
|
||||||
this.menuImportRulesFromFile.Click += new System.EventHandler(this.menuImportRulesFromFile_Click);
|
this.menuImportRulesFromFile.Click += new System.EventHandler(this.menuImportRulesFromFile_Click);
|
||||||
//
|
//
|
||||||
// menuImportRulesFromClipboard
|
// menuImportRulesFromClipboard
|
||||||
//
|
//
|
||||||
this.menuImportRulesFromClipboard.Name = "menuImportRulesFromClipboard";
|
|
||||||
resources.ApplyResources(this.menuImportRulesFromClipboard, "menuImportRulesFromClipboard");
|
resources.ApplyResources(this.menuImportRulesFromClipboard, "menuImportRulesFromClipboard");
|
||||||
|
this.menuImportRulesFromClipboard.Name = "menuImportRulesFromClipboard";
|
||||||
this.menuImportRulesFromClipboard.Click += new System.EventHandler(this.menuImportRulesFromClipboard_Click);
|
this.menuImportRulesFromClipboard.Click += new System.EventHandler(this.menuImportRulesFromClipboard_Click);
|
||||||
//
|
//
|
||||||
// menuImportRulesFromUrl
|
// menuImportRulesFromUrl
|
||||||
//
|
//
|
||||||
this.menuImportRulesFromUrl.Name = "menuImportRulesFromUrl";
|
|
||||||
resources.ApplyResources(this.menuImportRulesFromUrl, "menuImportRulesFromUrl");
|
resources.ApplyResources(this.menuImportRulesFromUrl, "menuImportRulesFromUrl");
|
||||||
|
this.menuImportRulesFromUrl.Name = "menuImportRulesFromUrl";
|
||||||
this.menuImportRulesFromUrl.Click += new System.EventHandler(this.menuImportRulesFromUrl_Click);
|
this.menuImportRulesFromUrl.Click += new System.EventHandler(this.menuImportRulesFromUrl_Click);
|
||||||
//
|
//
|
||||||
// RoutingRuleSettingForm
|
// RoutingRuleSettingForm
|
||||||
|
@ -319,5 +349,9 @@
|
||||||
private System.Windows.Forms.TextBox txtUrl;
|
private System.Windows.Forms.TextBox txtUrl;
|
||||||
private System.Windows.Forms.Label label3;
|
private System.Windows.Forms.Label label3;
|
||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.TextBox txtCustomIcon;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Button btnBrowse;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -38,6 +38,7 @@ namespace v2rayN.Forms
|
||||||
|
|
||||||
txtRemarks.Text = routingItem.remarks ?? string.Empty;
|
txtRemarks.Text = routingItem.remarks ?? string.Empty;
|
||||||
txtUrl.Text = routingItem.url ?? string.Empty;
|
txtUrl.Text = routingItem.url ?? string.Empty;
|
||||||
|
txtCustomIcon.Text = routingItem.customIcon ?? string.Empty;
|
||||||
|
|
||||||
InitRoutingsView();
|
InitRoutingsView();
|
||||||
RefreshRoutingsView();
|
RefreshRoutingsView();
|
||||||
|
@ -93,6 +94,7 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
routingItem.remarks = txtRemarks.Text.Trim();
|
routingItem.remarks = txtRemarks.Text.Trim();
|
||||||
routingItem.url = txtUrl.Text.Trim();
|
routingItem.url = txtUrl.Text.Trim();
|
||||||
|
routingItem.customIcon = txtCustomIcon.Text.Trim();
|
||||||
|
|
||||||
if (ConfigHandler.AddRoutingItem(ref config, routingItem, EditIndex) == 0)
|
if (ConfigHandler.AddRoutingItem(ref config, routingItem, EditIndex) == 0)
|
||||||
{
|
{
|
||||||
|
@ -108,6 +110,14 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
this.DialogResult = DialogResult.Cancel;
|
this.DialogResult = DialogResult.Cancel;
|
||||||
}
|
}
|
||||||
|
private void btnBrowse_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OpenFileDialog openFileDialog1 = new OpenFileDialog();
|
||||||
|
openFileDialog1.Filter = "PNG|*.png";
|
||||||
|
openFileDialog1.ShowDialog();
|
||||||
|
txtCustomIcon.Text = openFileDialog1.FileName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void lvRoutings_DoubleClick(object sender, EventArgs e)
|
private void lvRoutings_DoubleClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -340,8 +350,9 @@ namespace v2rayN.Forms
|
||||||
return ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData, blReplace);
|
return ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData, blReplace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -120,16 +120,31 @@
|
||||||
<data name="btnClose.Text" xml:space="preserve">
|
<data name="btnClose.Text" xml:space="preserve">
|
||||||
<value>取消(&C)</value>
|
<value>取消(&C)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="btnOK.Text" xml:space="preserve">
|
|
||||||
<value>确定(&O)</value>
|
|
||||||
</data>
|
|
||||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
<value>0, 613</value>
|
<value>0, 501</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>785, 60</value>
|
<value>785, 60</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="btnOK.Text" xml:space="preserve">
|
||||||
|
<value>确定(&O)</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>785, 147</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnBrowse.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>670, 104</value>
|
||||||
|
</data>
|
||||||
|
<data name="txtCustomIcon.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>101, 105</value>
|
||||||
|
</data>
|
||||||
|
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>65, 12</value>
|
||||||
|
</data>
|
||||||
|
<data name="label4.Text" xml:space="preserve">
|
||||||
|
<value>自定义图标</value>
|
||||||
|
</data>
|
||||||
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>29, 12</value>
|
<value>29, 12</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -154,9 +169,6 @@
|
||||||
<data name="label2.Text" xml:space="preserve">
|
<data name="label2.Text" xml:space="preserve">
|
||||||
<value>别名</value>
|
<value>别名</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>785, 109</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>196, 22</value>
|
<value>196, 22</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -235,19 +247,28 @@
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>771, 447</value>
|
<value>771, 297</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>0, 172</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>785, 329</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>777, 453</value>
|
<value>777, 303</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabPage2.Text" xml:space="preserve">
|
<data name="tabPage2.Text" xml:space="preserve">
|
||||||
<value>规则列表</value>
|
<value>规则列表</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>0, 134</value>
|
<value>785, 25</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>785, 479</value>
|
<value>68, 21</value>
|
||||||
|
</data>
|
||||||
|
<data name="toolStripMenuItem1.Text" xml:space="preserve">
|
||||||
|
<value>导入规则</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>189, 22</value>
|
<value>189, 22</value>
|
||||||
|
@ -267,17 +288,8 @@
|
||||||
<data name="menuImportRulesFromUrl.Text" xml:space="preserve">
|
<data name="menuImportRulesFromUrl.Text" xml:space="preserve">
|
||||||
<value>从订阅Url中导入规则</value>
|
<value>从订阅Url中导入规则</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>68, 21</value>
|
|
||||||
</data>
|
|
||||||
<data name="toolStripMenuItem1.Text" xml:space="preserve">
|
|
||||||
<value>导入规则</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>785, 25</value>
|
|
||||||
</data>
|
|
||||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>785, 673</value>
|
<value>785, 561</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="$this.Text" xml:space="preserve">
|
<data name="$this.Text" xml:space="preserve">
|
||||||
<value>规则集设置</value>
|
<value>规则集设置</value>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
@ -50,9 +51,23 @@ namespace v2rayN.Handler
|
||||||
Graphics graphics = Graphics.FromImage(bitmap);
|
Graphics graphics = Graphics.FromImage(bitmap);
|
||||||
SolidBrush drawBrush = new SolidBrush(color);
|
SolidBrush drawBrush = new SolidBrush(color);
|
||||||
|
|
||||||
|
var customIcon = false;
|
||||||
|
if (config.enableRoutingAdvanced)
|
||||||
|
{
|
||||||
|
var item = config.routings[config.routingIndex];
|
||||||
|
if (!Utils.IsNullOrEmpty(item.customIcon) && File.Exists(item.customIcon))
|
||||||
|
{
|
||||||
|
graphics.FillRectangle(drawBrush, new Rectangle(0, 0, width, height));
|
||||||
|
graphics.DrawImage(new Bitmap(item.customIcon), 0, 0);
|
||||||
|
customIcon = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!customIcon)
|
||||||
|
{
|
||||||
graphics.FillEllipse(drawBrush, new Rectangle(0, 0, width, height));
|
graphics.FillEllipse(drawBrush, new Rectangle(0, 0, width, height));
|
||||||
int zoom = 16;
|
int zoom = 16;
|
||||||
graphics.DrawImage(new Bitmap(Properties.Resources.notify, width - zoom, width - zoom), zoom / 2, zoom / 2);
|
graphics.DrawImage(new Bitmap(Properties.Resources.notify, width - zoom, width - zoom), zoom / 2, zoom / 2);
|
||||||
|
}
|
||||||
|
|
||||||
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
|
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,9 @@ namespace v2rayN.Mode
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
public string customIcon
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue