From 1fb180595655bee10f16491000afa7170c9966a9 Mon Sep 17 00:00:00 2001 From: rexmyl Date: Fri, 2 Jun 2023 21:44:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=8C=96=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=AD=E7=9A=84=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E6=9C=80=E5=A4=9A=E6=98=BE=E7=A4=BA20=E4=B8=AA,=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index d63fdc00..030d1a5e 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -14,6 +14,7 @@ using System.Reactive; using System.Reactive.Linq; using System.Text; using System.Windows; +using System.Windows.Controls; using System.Windows.Media; using v2rayN.Base; using v2rayN.Handler; @@ -952,13 +953,25 @@ namespace v2rayN.ViewModels } })); } - + private void RefreshServersMenu() { _servers.Clear(); if (_lstProfile.Count > _config.guiItem.trayMenuServersLimit) { - BlServers = false; + BlServers = true; + for (int k = 0; k < _config.guiItem.trayMenuServersLimit; k++) + { + ProfileItem it = _lstProfile[k]; + string name = it.GetSummary(); + + var item = new ComboItem() { ID = it.indexId, Text = name }; + _servers.Add(item); + if (_config.indexId == it.indexId) + { + SelectedServer = item; + } + } return; }