public frmHistDisplay(clsHistogramPar clsHistPar) { mclsHistPar = clsHistPar; InitializeComponent(); this.mnuItemPara.Click += new System.EventHandler(this.mnuItemPara_Click); this.parametersToolStripMenuItem.Click += new System.EventHandler(this.mnuItemPara_Click); this.mtBtnParam.Click += new System.EventHandler(this.mnuItemPara_Click); }
// this will be called from the plot forms. // thus the reason to be public public void PlotHistograms(clsHistogramPar clsHistPar) { if (mtabControlData.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_HistPlotCompleted; #endregion var mfrmHistPar = new frmHistogramPar(clsHistPar); var res = mfrmHistPar.ShowDialog(); if (res == DialogResult.OK) { mclsHistPar = mfrmHistPar.clsHistPar; var mclsRplots = new clsRplotData(clsHistPar.Rcmd, "Hist"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating Histograms ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_HistPlotCompleted; #endregion } }
/// <summary> /// Plot histograms /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mnuHistogrms_Click(object sender, EventArgs e) { var mclsSelected = (clsDatasetTreeNode)ctltreeView.SelectedNode.Tag; if (!ValidateNodeIsSelected(mclsSelected)) { return; } if (!ValidateIsPlottable(mclsSelected, 2)) { return; } mclsHistPar = new clsHistogramPar(); var datasetNameInR = mclsSelected.mstrRdatasetName; mclsHistPar.tempFile = mRTempFilePath; mclsHistPar.Rdataset = datasetNameInR; mclsHistPar.Datasets = clsDataTable.DataTableColumns(mclsSelected.mDTable, datasetNameInR); mclsHistPar.mstrDatasetName = mclsSelected.mstrDataText; PlotHistograms(mclsHistPar); }
public frmHistogramPar(clsHistogramPar clsHistPar) { mclsHistPar = clsHistPar; InitializeComponent(); }