Ejemplo n.º 1
0
        private void btnDate_Click(object sender, EventArgs e)
        {
            if (this.dates == null)
            {
                this.dates = new SortedList <DateTime, int>();
                foreach (IDataObject idataObject in (IEnumerable)this.dataSeries)
                {
                    DateTime date = idataObject.DateTime.Date;
                    if (!this.dates.ContainsKey(date))
                    {
                        this.dates.Add(date, 0);
                    }
                    SortedList <DateTime, int> sortedList;
                    DateTime index;
                    (sortedList = this.dates)[index = date] = sortedList[index] + 1;
                }
            }
            DataSeriesCalendarForm seriesCalendarForm = new DataSeriesCalendarForm();

            seriesCalendarForm.Init((IDictionary <DateTime, int>) this.dates, this.selectedDate);
            if (seriesCalendarForm.ShowDialog((IWin32Window)this) == DialogResult.OK && this.selectedDate != seriesCalendarForm.SelectedDate)
            {
                this.selectedDate = seriesCalendarForm.SelectedDate;
                this.UpdateChart();
            }
            seriesCalendarForm.Dispose();
        }
Ejemplo n.º 2
0
 private void btnDate_Click(object sender, EventArgs e)
 {
   if (this.dates == null)
   {
     this.dates = new SortedList<DateTime, int>();
     foreach (IDataObject idataObject in (IEnumerable) this.dataSeries)
     {
       DateTime date = idataObject.DateTime.Date;
       if (!this.dates.ContainsKey(date))
         this.dates.Add(date, 0);
       SortedList<DateTime, int> sortedList;
       DateTime index;
       (sortedList = this.dates)[index = date] = sortedList[index] + 1;
     }
   }
   DataSeriesCalendarForm seriesCalendarForm = new DataSeriesCalendarForm();
   seriesCalendarForm.Init((IDictionary<DateTime, int>) this.dates, this.selectedDate);
   if (seriesCalendarForm.ShowDialog((IWin32Window) this) == DialogResult.OK && this.selectedDate != seriesCalendarForm.SelectedDate)
   {
     this.selectedDate = seriesCalendarForm.SelectedDate;
     this.UpdateChart();
   }
   seriesCalendarForm.Dispose();
 }