//===================================================================================================== // Menu: File | New... //===================================================================================================== private void newToolStripMenuItem_Click(object sender, EventArgs e) { TimeSeriesCreationDialog timeSeriesCreationDialog = new TimeSeriesCreationDialog(); timeSeriesCreationDialog.ShowDialog(); this.timeSeriesGroup = new TimeSeriesGroup(); BaseTimeSeries timeseries = timeSeriesCreationDialog.TimeSeries; timeSeriesGroup.Items.Add(timeseries); if (timeseries is TimestampSeries) { this.timestampSeriesGrid.TimeSeriesData = (TimestampSeries)timeseries; this.timespanSeriesGrid.Visible = false; this.timestampSeriesGrid.Visible = true; } else if (timeseries is TimespanSeries) { this.timespanSeriesGrid.TimeSeriesData = (TimespanSeries)timeseries; this.timestampSeriesGrid.Visible = false; this.timespanSeriesGrid.Visible = true; } this.tsPlot.TimeSeriesDataSet = this.timeSeriesGroup; this.tsPlot.Repaint(); this.tsPlot.Visible = true; }
//======================================================================================= // Menu: File | Add | New time series... //======================================================================================= private void newTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) { TimeSeriesCreationDialog timeSeriesCreationDialog = new TimeSeriesCreationDialog(); timeSeriesCreationDialog.ShowDialog(); timeSeriesGroup.Items.Add(timeSeriesCreationDialog.TimeSeries); this.tsPlot.Initialize(); this.tsPlot.Repaint(); this.tsPlot.Visible = true; timeSeriesGroup.Current = timeSeriesGroup.Items.Count - 1; }