private void btnEdit_Click(object sender, EventArgs e) { ListViewItem item = this.listView1.SelectedItems[0]; IHistoricalMarker tag = item.Tag as IHistoricalMarker; frmHistoricalMarker marker2 = new frmHistoricalMarker { HistoricalMarker = tag }; if (marker2.ShowDialog() == DialogResult.OK) { this.m_pHistoricalWorkspace.RemoveHistoricalMarker(tag.Name); tag = this.m_pHistoricalWorkspace.AddHistoricalMarker(marker2.HistoricalMarkerName, marker2.HistoricalMarkerTimeStamp); item.Text = tag.Name; item.SubItems[1].Text = tag.TimeStamp.ToString(); } }
private void btnNew_Click(object sender, EventArgs e) { frmHistoricalMarker marker = new frmHistoricalMarker { DatabaseConnectionInfo = this.m_pHistoricalWorkspace as IDatabaseConnectionInfo2 }; if (marker.ShowDialog() == DialogResult.OK) { IHistoricalMarker marker2 = null; if (marker2 != null) { MessageBox.Show("名称的时间标记以存在!"); } else { this.AddToList(this.m_pHistoricalWorkspace.AddHistoricalMarker(marker.HistoricalMarkerName, marker.HistoricalMarkerTimeStamp)); } } }