mirror of
https://github.com/netchx/netch.git
synced 2026-03-28 18:59:46 +08:00
:bug:修复模式选择下拉框的崩溃bug
This commit is contained in:
@@ -255,7 +255,7 @@ namespace Netch.Forms
|
|||||||
private void SaveConfigs()
|
private void SaveConfigs()
|
||||||
{
|
{
|
||||||
Global.Settings.ServerComboBoxSelectedIndex = ServerComboBox.SelectedIndex;
|
Global.Settings.ServerComboBoxSelectedIndex = ServerComboBox.SelectedIndex;
|
||||||
if (ModeComboBox.SelectedItem != null)
|
if (ModeComboBox.Items.Count!=0 && ModeComboBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ModeComboBox.Tag is object[] list)
|
if (ModeComboBox.Tag is object[] list)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Microsoft.Win32;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -121,9 +120,12 @@ namespace Netch
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void Application_OnException(object sender, ThreadExceptionEventArgs e)
|
public static void Application_OnException(object sender, ThreadExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
if (!e.Exception.ToString().Contains("ComboBox"))
|
||||||
{
|
{
|
||||||
MessageBox.Show(e.Exception.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(e.Exception.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
Application.Exit();
|
}
|
||||||
|
//Application.Exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ namespace System.Windows.Forms
|
|||||||
private string _previousSearchTerm;
|
private string _previousSearchTerm;
|
||||||
private object[] newList;
|
private object[] newList;
|
||||||
private void ReevaluateCompletionList()
|
private void ReevaluateCompletionList()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var currentSearchTerm = Text.ToLowerInvariant();
|
var currentSearchTerm = Text.ToLowerInvariant();
|
||||||
if (currentSearchTerm == _previousSearchTerm) return;
|
if (currentSearchTerm == _previousSearchTerm) return;
|
||||||
@@ -147,5 +149,10 @@ namespace System.Windows.Forms
|
|||||||
ResumeLayout(true);
|
ResumeLayout(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user