private void DeleteRange()
 {
     if (this.dataSeries.Count == 0)
     {
         int num1 = (int)MessageBox.Show((IWin32Window)this, "The series is empty.", "", MessageBoxButtons.OK, MessageBoxIcon.None);
     }
     else
     {
         DeleteRangeForm deleteRangeForm = new DeleteRangeForm();
         deleteRangeForm.SetRange(this.dataSeries.FirstDateTime, this.dataSeries.LastDateTime);
         if (deleteRangeForm.ShowDialog((IWin32Window)this) == DialogResult.OK)
         {
             try
             {
                 this.Cursor = Cursors.WaitCursor;
                 if (deleteRangeForm.From > this.dataSeries.LastDateTime || deleteRangeForm.To < this.dataSeries.FirstDateTime)
                 {
                     int num2 = (int)MessageBox.Show((IWin32Window)this, "No items found with in the specified range.", "", MessageBoxButtons.OK, MessageBoxIcon.None);
                 }
                 int num3 = this.dataSeries.IndexOf(deleteRangeForm.From.AddTicks(-1L), (SearchOption)2);
                 int num4 = this.dataSeries.IndexOf(deleteRangeForm.To.AddTicks(1L), (SearchOption)0);
                 if (num3 != -1 && num4 != -1 && MessageBox.Show((IWin32Window)this, "Are you sure you want to delete " + (num4 - num3 + 1).ToString() + " items?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                 {
                     for (int index = num3; index <= num4; ++index)
                     {
                         this.dataSeries.RemoveAt(num3);
                     }
                     this.Init();
                     int num5 = (int)MessageBox.Show((IWin32Window)this, (num4 - num3 + 1).ToString() + " items removed successfully", "", MessageBoxButtons.OK, MessageBoxIcon.None);
                 }
                 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);
             }
         }
         deleteRangeForm.Dispose();
     }
 }
Exemple #2
0
 private void DeleteRange()
 {
   if (this.dataSeries.Count == 0)
   {
     int num1 = (int) MessageBox.Show((IWin32Window) this, "The series is empty.", "", MessageBoxButtons.OK, MessageBoxIcon.None);
   }
   else
   {
     DeleteRangeForm deleteRangeForm = new DeleteRangeForm();
     deleteRangeForm.SetRange(this.dataSeries.FirstDateTime, this.dataSeries.LastDateTime);
     if (deleteRangeForm.ShowDialog((IWin32Window) this) == DialogResult.OK)
     {
       try
       {
         this.Cursor = Cursors.WaitCursor;
         if (deleteRangeForm.From > this.dataSeries.LastDateTime || deleteRangeForm.To < this.dataSeries.FirstDateTime)
         {
           int num2 = (int) MessageBox.Show((IWin32Window) this, "No items found with in the specified range.", "", MessageBoxButtons.OK, MessageBoxIcon.None);
         }
         int num3 = this.dataSeries.IndexOf(deleteRangeForm.From.AddTicks(-1L), (SearchOption) 2);
         int num4 = this.dataSeries.IndexOf(deleteRangeForm.To.AddTicks(1L), (SearchOption) 0);
         if (num3 != -1 && num4 != -1 && MessageBox.Show((IWin32Window) this, "Are you sure you want to delete " + (num4 - num3 + 1).ToString() + " items?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
           for (int index = num3; index <= num4; ++index)
             this.dataSeries.RemoveAt(num3);
           this.Init();
           int num5 = (int) MessageBox.Show((IWin32Window) this, (num4 - num3 + 1).ToString() + " items removed successfully", "", MessageBoxButtons.OK, MessageBoxIcon.None);
         }
         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);
       }
     }
     deleteRangeForm.Dispose();
   }
 }