mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 21:52:25 +00:00
simplify
This commit is contained in:
parent
910be7f471
commit
4e449811e7
3 changed files with 21 additions and 39 deletions
|
@ -126,7 +126,9 @@ namespace v2rayN.Forms
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 窗口大小和列宽等取/存
|
||||||
private void RestoreUI()
|
private void RestoreUI()
|
||||||
{
|
{
|
||||||
scMain.Panel2Collapsed = true;
|
scMain.Panel2Collapsed = true;
|
||||||
|
@ -137,10 +139,10 @@ namespace v2rayN.Forms
|
||||||
this.Height = config.uiItem.mainSize.Height;
|
this.Height = config.uiItem.mainSize.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int k = 0; k < lvServers.Columns.Count; k++)
|
foreach (ColumnHeader c in lvServers.Columns)
|
||||||
{
|
{
|
||||||
var width = ConfigHandler.GetformMainLvColWidth(ref config, ((EServerColName)k).ToString(), lvServers.Columns[k].Width);
|
var width = ConfigHandler.GetformMainLvColWidth(ref config, c.Name, c.Width);
|
||||||
lvServers.Columns[k].Width = width;
|
c.Width = width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,9 +150,9 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
config.uiItem.mainSize = new Size(this.Width, this.Height);
|
config.uiItem.mainSize = new Size(this.Width, this.Height);
|
||||||
|
|
||||||
for (int k = 0; k < lvServers.Columns.Count; k++)
|
foreach (ColumnHeader c in lvServers.Columns)
|
||||||
{
|
{
|
||||||
ConfigHandler.AddformMainLvColWidth(ref config, ((EServerColName)k).ToString(), lvServers.Columns[k].Width);
|
ConfigHandler.AddformMainLvColWidth(ref config, c.Name, c.Width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,20 +244,22 @@ namespace v2rayN.Forms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ListViewItem lvItem = new ListViewItem(def);
|
ListViewItem lvItem = new ListViewItem(def);
|
||||||
_addSubItem(lvItem, EServerColName.type.ToString(), ((EConfigType)item.configType).ToString());
|
_addSubItem(lvItem, "type", ((EConfigType)item.configType).ToString());
|
||||||
_addSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks);
|
_addSubItem(lvItem, "remarks", item.remarks);
|
||||||
_addSubItem(lvItem, EServerColName.address.ToString(), item.address);
|
_addSubItem(lvItem, "address", item.address);
|
||||||
_addSubItem(lvItem, EServerColName.port.ToString(), item.port.ToString());
|
_addSubItem(lvItem, "port", item.port.ToString());
|
||||||
_addSubItem(lvItem, EServerColName.security.ToString(), item.security);
|
//_addSubItem(lvItem, "id", item.id);
|
||||||
_addSubItem(lvItem, EServerColName.network.ToString(), item.network);
|
//_addSubItem(lvItem, "alterId", item.alterId.ToString());
|
||||||
_addSubItem(lvItem, EServerColName.subRemarks.ToString(), item.getSubRemarks(config));
|
_addSubItem(lvItem, "security", item.security);
|
||||||
_addSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult);
|
_addSubItem(lvItem, "network", item.network);
|
||||||
|
_addSubItem(lvItem, "SubRemarks", item.getSubRemarks(config));
|
||||||
|
_addSubItem(lvItem, "testResult", item.testResult);
|
||||||
if (stats)
|
if (stats)
|
||||||
{
|
{
|
||||||
_addSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown);
|
_addSubItem(lvItem, "todayDown", todayDown);
|
||||||
_addSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp);
|
_addSubItem(lvItem, "todayUp", todayUp);
|
||||||
_addSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown);
|
_addSubItem(lvItem, "totalDown", totalDown);
|
||||||
_addSubItem(lvItem, EServerColName.totalUp.ToString(), totalUp);
|
_addSubItem(lvItem, "totalUp", totalUp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.interlaceColoring && k % 2 == 1) // 隔行着色
|
if (config.interlaceColoring && k % 2 == 1) // 隔行着色
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
|
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
|
||||||
public enum EServerColName
|
|
||||||
{
|
|
||||||
def = 0,
|
|
||||||
type,
|
|
||||||
remarks,
|
|
||||||
address,
|
|
||||||
port,
|
|
||||||
security,
|
|
||||||
network,
|
|
||||||
subRemarks,
|
|
||||||
testResult,
|
|
||||||
|
|
||||||
todayDown,
|
|
||||||
todayUp,
|
|
||||||
totalDown,
|
|
||||||
totalUp
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -157,7 +157,6 @@
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="HttpProxyHandler\SysProxyHandle.cs" />
|
<Compile Include="HttpProxyHandler\SysProxyHandle.cs" />
|
||||||
<Compile Include="Mode\EMove.cs" />
|
<Compile Include="Mode\EMove.cs" />
|
||||||
<Compile Include="Mode\EServerColName.cs" />
|
|
||||||
<Compile Include="Mode\ServerStatistics.cs" />
|
<Compile Include="Mode\ServerStatistics.cs" />
|
||||||
<Compile Include="Mode\SysproxyConfig.cs" />
|
<Compile Include="Mode\SysproxyConfig.cs" />
|
||||||
<Compile Include="Mode\EConfigType.cs" />
|
<Compile Include="Mode\EConfigType.cs" />
|
||||||
|
|
Loading…
Reference in a new issue