private ListViewItem ProfileToListViewItem(ConfigManager.ProfileData profile) { var item = new ListViewItem(); /* メイン */ item.Tag = profile; /* サブ */ foreach (ColumnHeader column in LView_ProfileList.Columns) { item.SubItems.Add(ProfileToListViewSubItem((ProfileListSubColumnID)column.Tag, profile)); } return(item); }
private ListViewItem.ListViewSubItem ProfileToListViewSubItem(ProfileListSubColumnID column_id, ConfigManager.ProfileData profile) { var item = new ListViewItem.ListViewSubItem(); switch (column_id) { case ProfileListSubColumnID.CreateDateTime: item.Text = profile.Config.CreateDateTime.Value.ToLocalTime().ToString("yyyy-MM-dd"); break; case ProfileListSubColumnID.ProfileName: item.Text = profile.Config.ProfileName.Value; break; } return(item); }