public PlotPropertyWindow(CsvPlotter.PlotTypes plotType)
        {
            this.plotType = plotType;

            InitializeComponent();
            InitializePlotPropertyGrid();
        }
        private void StartPlotBtn_Click(object sender, EventArgs e)
        {
            //get the plot type selected by user from combo box
            CsvPlotter.PlotTypes plotType = EnumConverter.ToEnum <CsvPlotter.PlotTypes>(cbPlotType.SelectedItem as string);


            using (PlotPropertyWindow plotPropertyWindow = new PlotPropertyWindow(plotType))
            {
                plotPropertyWindow.ShowDialog();
            }
        }
Example #3
0
 //initialize property grid 's properties field according to the plot type
 private void InitializePlotPropertyGrid(CsvPlotter.PlotTypes plotType)
 {
     switch (plotType)
     {
         case CsvPlotter.PlotTypes.Histogram:
             this.pgPlotProperty.SelectedObject = new HistogramAttributes();
             break;
         case CsvPlotter.PlotTypes.Scatter:
             this.pgPlotProperty.SelectedObject = new ScatterAttributes();
             break;
         case CsvPlotter.PlotTypes.LineOrMarker:
             this.pgPlotProperty.SelectedObject = new LineOrMarkerAttributes();
             break;
     }
 }