Exemple #1
0
        private void PlotButton_Click(object sender, RoutedEventArgs e)
        {
            if (SelectedTags != null && selectedFiles != null)
            {
                try
                {
                    WriteSettings();
                    PlotWindow plotWindow = new PlotWindow(StartDateTime, EndDateTime, SelectedTags, SelectedFiles, Interval, Resolution, this);
                    plotWindows.Add(plotWindow);
                    plotWindow.Show();
                    WeakEventManager <PlotWindow, EventArgs> .AddHandler(plotWindow, "Closed", OnPlotWindowClosed);

                    WeakEventManager <PlotWindow, PlotRangeChangedEventArgs> .AddHandler(plotWindow, "PlotRangeChanged", OnPlotWindowRangeChanged);

                    GC.Collect();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: Fail to show plot window. Original error: " + ex.Message + "\n" + ex.StackTrace);
                }
            }
        }
 public PlotRangeChangedEventArgs(DateTime startDateTime, DateTime endDateTime, PlotWindow initialSource)
 {
     StartDateTime = startDateTime;
     EndDateTime   = endDateTime;
     InitialSource = initialSource;
 }