//
        private void lToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = "c:\\";
            openFileDialog1.Filter           = "txt files (*.gps)|*gps|All files (*.*)|*.*";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Degree degree = XMLSerializer.DeserializeXMLToDegree(openFileDialog1.FileName);

                mCoursesTaken = degree.TakenCourses;
                mDegree       = degree;
                uiClassList.SetTakenClass(mCoursesTaken);
                // RegisterClicks();
                //add the degree control to the tab

                while (mDegree.Semesters.Count < mDegree.MaxSemesters)
                {
                    mDegree.Semesters.Add(new Semester());
                }

                DegreeControl page = new DegreeControl(mDegree, mCoursesTaken, this, "Default");
                mTabs.Items.Clear();
                mTabs.Items.Add(page);

                //this.RegCourses(degree);
            }
        }
        //contructor
        public GenerateSchedulesForm(String degreeType, Degree degree, DBClass db)
        {
            InitializeComponent();
            //setup the class list
            uiClassList             = new ClassListUI(this);
            this.elementHost3.Child = uiClassList;
            mDb = db;
            //setup the degree and taken list
            mDegree = degree;
            // removes classes taken from the default schedule

            mCoursesTaken = degree.TakenCourses;
            uiClassList.SetTakenClass(mCoursesTaken);
            // RegisterClicks();
            //add the degree control to the tab

            while (mDegree.Semesters.Count < mDegree.MaxSemesters)
            {
                mDegree.Semesters.Add(new Semester());
            }

            DegreeControl page = new DegreeControl(mDegree, mCoursesTaken, this, "Default");

            mTabs = new System.Windows.Controls.TabControl();
            mTabs.Items.Add(page);
            elementHost1.Child      = mTabs;
            mTabs.SelectionChanged += new WPF.SelectionChangedEventHandler(mTabs_SelectionChanged);
            uiClassList.lstElectives.SelectionChanged += new WPF.SelectionChangedEventHandler(lstElectives_SelectionChanged);
            //UpdateCourseList(mDegree, control);
            //mDegreeControls.Add(control);

            List <string> codes = db.GetDegreeCodes();

            this.cmboDegreeSwitch.Items.Clear();
            foreach (string code in codes)
            {
                cmboDegreeSwitch.Items.Add(code);
            }
        }