private void RunPreferrenceEstimation()
 {
     using (PreferrenceEstimationWnd pewnd = new PreferrenceEstimationWnd())
     {
         pewnd.Show();
         MAPresApplication.Workspace.PerformPreferrenceEstimation(pewnd.OnPreferrenceEstimationProgressUpdate);
         MessageBox.Show("Preferrence Estimation Performed");
     }
 }
        private void RunPreferrenceEstimationOnAll()
        {
            PreferrenceEstimationWnd pewnd;

            foreach (string sub in MAPresApplication.Workspace.SubjectNames)
            {
                cmbTargetsOfStudy.Text = sub;
                MAPresApplication.Workspace.SelectedSubject = sub;
                using (pewnd = new PreferrenceEstimationWnd())
                {
                    pewnd.Show();
                    MAPresApplication.Workspace.PerformPreferrenceEstimation(pewnd.OnPreferrenceEstimationProgressUpdate);
                }
                Application.DoEvents();
            }
            MessageBox.Show("Preferrence Estimation Performed");
        }