private void listView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { List <RecordMon.Record> obj = this.records; lock (obj) { try { RecordMon.Record record; if (e.ItemIndex >= this.records.Count) { record = new RecordMon.Record(); record.Id = -1; record.Service = ""; record.Start = DateTime.Now; record.End = DateTime.Now; record.Title = ""; record.Status = 0; record.Tuner = ""; record.Host = ""; record.Time = ""; } else { record = this.records[e.ItemIndex]; } ListViewItem listViewItem = new ListViewItem(); listViewItem.Text = record.Title; listViewItem.SubItems.Add(record.Service); listViewItem.SubItems.Add(record.Time); string text = "OK"; if ((record.Status & 32) > 0) { text = "重複"; listViewItem.BackColor = Color.Gold; } if ((record.Status & 64) > 0) { text = "録画中"; listViewItem.BackColor = Color.LightCoral; } listViewItem.SubItems.Add(text); listViewItem.SubItems.Add(record.Host); listViewItem.SubItems.Add(record.Tuner); e.Item = listViewItem; } catch { } } }
private void listView_ItemActivate(object sender, EventArgs arg) { try { List <RecordMon.Record> obj = this.records; lock (obj) { RecordMon.Record record = this.records[this.listView.FocusedItem.Index]; Process.Start(string.Concat(new object[] { "http://", record.Host, "/maid/record-edit.html?id=", record.Id })); } } catch (Exception ex) { MessageBox.Show("ブラウザの起動に失敗しました。[詳細]" + ex.Message, this.Text); } }