private void InitializeProfileList() { var columns_list = new [] { new { id = ProfileListSubColumnID.CreateDateTime, width = 120, text = "Create Datetime" }, new { id = ProfileListSubColumnID.ProfileName, width = 120, text = "Profile Name" }, }; LView_ProfileList.BeginUpdate(); { var column = (ColumnHeader)null; /* メインヘッダー */ column = new ColumnHeader(); column.Text = "No."; column.Width = 50; LView_ProfileList.Columns.Add(column); /* サブヘッダー */ foreach (var info in columns_list) { column = new ColumnHeader(); column.Text = info.text; column.Width = info.width; column.Tag = info.id; LView_ProfileList.Columns.Add(column); } } LView_ProfileList.EndUpdate(); }
private void UpdateProfileList() { var item = (ListViewItem)null; LView_ProfileList.BeginUpdate(); { LView_ProfileList.Items.Clear(); foreach (var profile in ConfigManager.GetProfileList()) { item = ProfileToListViewItem(profile); if (item == null) { continue; } LView_ProfileList.Items.Add(item); } } LView_ProfileList.EndUpdate(); }