/*------------------------------------------------------------------------- * 選択されているinfoを選択する * ---------------------------------------------------------------------------*/ private void update_select_info() { GvoWorldInfo.Info info = m_item_window.info; if (info != null) { foreach (ListViewItem i in listView2.Items) { object tag = i.Tag; if (tag == null) { continue; } spot.spot_once s = (spot.spot_once)tag; if (s.info.Name != info.Name) { continue; } // 選択状態にし、見える位置にスクロールさせる i.Selected = true; i.EnsureVisible(); i.Focused = true; return; } } // 選択中のinfoが含まれない場合は1番目を選択状態にする // 文化圏のスポット時 if (listView2.Items.Count > 0) { listView2.Items[0].Selected = true; } }
/*------------------------------------------------------------------------- * スポット結果の選択が更新された * ---------------------------------------------------------------------------*/ private void listView2_SelectedIndexChanged(object sender, EventArgs e) { if (listView2.SelectedIndices.Count <= 0) { return; } if (listView2.SelectedItems[0].Tag == null) { return; } spot.spot_once s = listView2.SelectedItems[0].Tag as spot.spot_once; if (s == null) { return; } m_lib.setting.req_spot_item_changed.Request(s); }