mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-10-22 20:09:46 +08:00
Add Mail editor (WIP)
Update Drop editor indexes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GrasscutterTools.Utils
|
||||
@@ -19,5 +20,20 @@ namespace GrasscutterTools.Utils
|
||||
btn.Text = t;
|
||||
btn.Enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表过滤
|
||||
/// </summary>
|
||||
/// <param name="listBox">列表控件</param>
|
||||
/// <param name="source">数据源</param>
|
||||
/// <param name="filter">过滤内容</param>
|
||||
public static void ListBoxFilter(ListBox listBox, string[] source, string filter)
|
||||
{
|
||||
filter = filter.Trim();
|
||||
listBox.BeginUpdate();
|
||||
listBox.Items.Clear();
|
||||
listBox.Items.AddRange(source.Where(n => n.Contains(filter)).ToArray());
|
||||
listBox.EndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user