private void GotoObject() { if (this.dataSeries.Count == 0) { int num1 = (int)MessageBox.Show((IWin32Window)this, "The series is empty.", "", MessageBoxButtons.OK, MessageBoxIcon.None); } else { GotoForm gotoForm = new GotoForm(); gotoForm.SetRange(this.dataSeries.FirstDateTime, this.dataSeries.LastDateTime); if (this.viewer.GetEditor() != null) { int num2 = this.listView.SelectedIndices[0]; if (num2 > 0 && num2 < this.dataSeries.Count) { gotoForm.SetInitialValue(this.dataSeries.DateTimeAt(num2)); } } if (gotoForm.ShowDialog((IWin32Window)this) == DialogResult.OK) { try { this.Cursor = Cursors.WaitCursor; int index = !(gotoForm.Result > this.dataSeries.LastDateTime) ? this.dataSeries.IndexOf(gotoForm.Result, (SearchOption)2) : this.dataSeries.Count - 1; if (index != -1) { this.listView.EnsureVisible(index); this.listView.Items[index].Selected = true; } this.Cursor = Cursors.Default; } catch { this.Cursor = Cursors.Default; int num2 = (int)MessageBox.Show((IWin32Window)this, "An error occuired while searching position. See log file for details.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } gotoForm.Dispose(); } }
private void GotoObject() { if (this.dataSeries.Count == 0) { int num1 = (int) MessageBox.Show((IWin32Window) this, "The series is empty.", "", MessageBoxButtons.OK, MessageBoxIcon.None); } else { GotoForm gotoForm = new GotoForm(); gotoForm.SetRange(this.dataSeries.FirstDateTime, this.dataSeries.LastDateTime); if (this.viewer.GetEditor() != null) { int num2 = this.listView.SelectedIndices[0]; if (num2 > 0 && num2 < this.dataSeries.Count) gotoForm.SetInitialValue(this.dataSeries.DateTimeAt(num2)); } if (gotoForm.ShowDialog((IWin32Window) this) == DialogResult.OK) { try { this.Cursor = Cursors.WaitCursor; int index = !(gotoForm.Result > this.dataSeries.LastDateTime) ? this.dataSeries.IndexOf(gotoForm.Result, (SearchOption) 2) : this.dataSeries.Count - 1; if (index != -1) { this.listView.EnsureVisible(index); this.listView.Items[index].Selected = true; } this.Cursor = Cursors.Default; } catch { this.Cursor = Cursors.Default; int num2 = (int) MessageBox.Show((IWin32Window) this, "An error occuired while searching position. See log file for details.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } gotoForm.Dispose(); } }