Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
 private void GotoObject()
 {
     if (this.dataSeries.Count == 0L)
     {
         int num1 = (int)MessageBox.Show((IWin32Window)this, "The series is empty.", "", MessageBoxButtons.OK, MessageBoxIcon.None);
     }
     else
     {
         GotoForm gotoForm = new GotoForm();
         gotoForm.SetRange(this.dataSeries.DateTime1, this.dataSeries.DateTime2);
         if (this.viewer.GetEditor() != null)
         {
             int num2 = this.listView.SelectedIndices[0];
             if (num2 > 0 && (long)num2 < this.dataSeries.Count)
             {
                 gotoForm.SetInitialValue(this.dataSeries[(long)num2].DateTime);
             }
         }
         if (gotoForm.ShowDialog((IWin32Window)this) == DialogResult.OK)
         {
             try
             {
                 this.Cursor = Cursors.WaitCursor;
                 int index = !(gotoForm.Result > this.dataSeries.DateTime2) ? (int)this.dataSeries.GetIndex(gotoForm.Result, SearchOption.Next) : (int)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();
     }
 }
Exemplo n.º 2
0
 private void GotoObject()
 {
   if (this.dataSeries.Count == 0L)
   {
     int num1 = (int) MessageBox.Show((IWin32Window) this, "The series is empty.", "", MessageBoxButtons.OK, MessageBoxIcon.None);
   }
   else
   {
     GotoForm gotoForm = new GotoForm();
     gotoForm.SetRange(this.dataSeries.DateTime1, this.dataSeries.DateTime2);
     if (this.viewer.GetEditor() != null)
     {
       int num2 = this.listView.SelectedIndices[0];
       if (num2 > 0 && (long) num2 < this.dataSeries.Count)
         gotoForm.SetInitialValue(this.dataSeries[(long) num2].DateTime);
     }
     if (gotoForm.ShowDialog((IWin32Window) this) == DialogResult.OK)
     {
       try
       {
         this.Cursor = Cursors.WaitCursor;
         int index = !(gotoForm.Result > this.dataSeries.DateTime2) ? (int) this.dataSeries.GetIndex(gotoForm.Result, SearchOption.Next) : (int) 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();
   }
 }