private void LoadFileListConfig() { CBox_FileList.BeginUpdate(); { CBox_FileList.Items.Clear(); foreach (var exp in ConfigManager.User.SendPanel_File_List.Value) { CBox_FileList.Items.Add(exp); } /* 先頭のアイテムを選択 */ if (CBox_FileList.Items.Count > 0) { CBox_FileList.SelectedIndex = 0; } } CBox_FileList.EndUpdate(); }
private void AddLog(string text) { CBox_FileList.BeginUpdate(); { var text_now = CBox_FileList.Text; /* 重複するコマンドを削除 */ CBox_FileList.Items.Remove(text); /* ログの最大値に合わせて古いログを削除 */ if (CBox_FileList.Items.Count >= (ConfigManager.User.SendPanelLogLimit.Value - 1)) { CBox_FileList.Items.RemoveAt(CBox_FileList.Items.Count - 1); } /* 先頭に追加 */ CBox_FileList.Items.Insert(0, text); /* コマンドを復元 */ CBox_FileList.Text = text_now; } CBox_FileList.EndUpdate(); }