}//End Open Create Quiz Form //Open Settings form private void accessTokenToolStripMenuItem1_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; accessTokenForm.StartPosition = FormStartPosition.CenterScreen; accessTokenForm.ShowDialog(); Cursor.Current = Cursors.Default; //Load Grading Queue GradingQueue gradingQueue = new GradingQueue(); //tab setup gradingQueue.TopLevel = false; gradingQueue.FormBorderStyle = FormBorderStyle.None; gradingQueue.Dock = DockStyle.Fill; tabPageGradingQueue.Controls.Add(gradingQueue); gradingQueue.Visible = true; }
private void SaveSettings() { Properties.Settings.Default.MongoDBUserName = TxbUserName.Text; Properties.Settings.Default.MongoDBPW = TxbPassword.Text; Properties.Settings.Default.MongoDBDefaultDB = txbDefaultDatabase.Text; Properties.Settings.Default.MongoDBGradingCollection = TxbGradingCollecion.Text; Properties.Settings.Default.MongoDBConnectionString = connectionString; Properties.Settings.Default.Save(); btnSave.Enabled = false; rtbOutput.Clear(); rtbOutput.AppendText("Settings Saved"); textChanged = false; var frm = Application.OpenForms.Cast <Form>().Where(x => x.Name == "GradingQueue").FirstOrDefault(); if (null != frm) { GradingQueue gradingForm = (GradingQueue)frm; gradingForm.ConnectToMongoDB(); frm = null; } }
//Loading Main form private void CanvasAPIMainForm_Load(object sender, EventArgs e) { //If there is no canvas token automatically open settings, this will generally only happen on the first opening. This is just a first time user check. if (Properties.Settings.Default.CurrentAccessToken == "No Access Token" || Properties.Settings.Default.CurrentAccessToken == "") { accessTokenForm.StartPosition = FormStartPosition.CenterScreen; accessTokenForm.ShowDialog(); } //loads main form components //Load assignment tab AssignmentForm assignForm = new AssignmentForm("Create Assignment"); //tab setup assignForm.TopLevel = false; assignForm.FormBorderStyle = FormBorderStyle.None; assignForm.Dock = DockStyle.Fill; tabPageAssign.Controls.Add(assignForm); assignForm.Visible = true; //Load quiz form QuizForm quizForm = new QuizForm("Create Quiz", "Create Quiz"); //tab setup quizForm.TopLevel = false; quizForm.FormBorderStyle = FormBorderStyle.None; quizForm.Dock = DockStyle.Fill; tabPageQuiz.Controls.Add(quizForm); quizForm.Visible = true; //Load pages form PagesForm pageForm = new PagesForm(); //tab setup pageForm.TopLevel = false; pageForm.FormBorderStyle = FormBorderStyle.None; pageForm.Dock = DockStyle.Fill; tabPagePages.Controls.Add(pageForm); pageForm.Visible = true; //Load courses form CoursesForm coursesForm = new CoursesForm(); //tab setup coursesForm.TopLevel = false; coursesForm.FormBorderStyle = FormBorderStyle.None; coursesForm.Dock = DockStyle.Fill; tabPageCourses.Controls.Add(coursesForm); coursesForm.Visible = true; //Load Module form ModuleForm moduleForm = new ModuleForm(); //tab setup moduleForm.TopLevel = false; moduleForm.FormBorderStyle = FormBorderStyle.None; moduleForm.Dock = DockStyle.Fill; tabPageModule.Controls.Add(moduleForm); moduleForm.Visible = true; //Load Grading Queue GradingQueue gradingQueue = new GradingQueue(); //tab setup gradingQueue.TopLevel = false; gradingQueue.FormBorderStyle = FormBorderStyle.None; gradingQueue.Dock = DockStyle.Fill; tabPageGradingQueue.Controls.Add(gradingQueue); gradingQueue.Visible = true; }//End Main Form Loading