Beispiel #1
0
 private void ShowMDIChild(DocumentWindow frm_template, string text, ToolStripMenuItem mni)
 {
     frm_template.MdiParent = this;
     frm_template.MnItem = mni;
     frm_template.TabText = text;
     frm_template.Show(dockPanel, DockState.Document);
     mni.Enabled = false;
 }
        private void SetupWindow(DocumentWindow window, NAntDocument doc)
        {
            _documents.Add(window, doc);
            _mainForm.AddDocumentMenuItem(doc);

            window.Contents = doc.Contents;
            window.TabText  = doc.Name;

            window.DocumentChanged        += WindowDocumentChanged;
            window.FormClosing            += CloseDocument;
            window.FormClosed             += WindowFormClosed;
            window.CloseClicked           += delegate { Close(); };
            window.CloseAllClicked        += delegate { CloseAllDocuments(); };
            window.CloseAllButThisClicked += delegate { CloseAllButThisClicked(); };
            window.SaveClicked            += delegate { SaveDocument(); };
            window.Leave += WindowLeave;
            window.Enter += WindowEnter;
            window.Show(_mainForm.DockPanel);
        }
Beispiel #3
0
 //User Settings clicked
 private void btnUser_Click(object sender, EventArgs e)
 {
     if (UserDockWindow == null)
     {
         UserDockWindow             = new DocumentWindow();
         UserDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmUserMain = new frmUserList();
         fmUserMain.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmUserMain.TopLevel        = false;
         fmUserMain.Dock            = DockStyle.Fill;
         UserDockWindow.Text        = fmUserMain.Text;
         UserDockWindow.Controls.Add(fmUserMain);
         this.radDock1.AddDocument(UserDockWindow);
         fmUserMain.Show();
     }
     else
     {
         UserDockWindow.Show();
     }
 }
Beispiel #4
0
 private void radButtonElement13_Click(object sender, EventArgs e)
 {
     if (PermanentRecordDockWindow == null)
     {
         PermanentRecordDockWindow             = new DocumentWindow();
         PermanentRecordDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmStudentSelection = new frmStudentSelection();
         fmStudentSelection.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmStudentSelection.TopLevel        = false;
         fmStudentSelection.Dock            = DockStyle.Fill;
         PermanentRecordDockWindow.Text     = fmStudentSelection.Text;
         PermanentRecordDockWindow.Controls.Add(fmStudentSelection);
         this.radDock1.AddDocument(PermanentRecordDockWindow);
         fmStudentSelection.Show();
     }
     else
     {
         PermanentRecordDockWindow.Show();
     }
     this.radDock1.ActiveWindow = PermanentRecordDockWindow;
 }
Beispiel #5
0
 private void btnTraitsGrading_Click(object sender, EventArgs e)
 {
     if (AdvisoryListDockWindow == null)
     {
         AdvisoryListDockWindow             = new DocumentWindow();
         AdvisoryListDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmAdvisersLoad = new frmAdvisersLoad();
         fmAdvisersLoad.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmAdvisersLoad.TopLevel        = false;
         fmAdvisersLoad.Dock            = DockStyle.Fill;
         AdvisoryListDockWindow.Text    = fmAdvisersLoad.Text;
         AdvisoryListDockWindow.Controls.Add(fmAdvisersLoad);
         this.radDock1.AddDocument(AdvisoryListDockWindow);
         fmAdvisersLoad.Show();
     }
     else
     {
         AdvisoryListDockWindow.Show();
     }
     this.radDock1.ActiveWindow = AdvisoryListDockWindow;
 }
Beispiel #6
0
 private void btnQuarterlyGrading_Click(object sender, EventArgs e)
 {
     if (TeacherLoadingWindow == null)
     {
         TeacherLoadingWindow             = new DocumentWindow();
         TeacherLoadingWindow.CloseAction = DockWindowCloseAction.Close;
         fmTeacherLoad = new frmTeacherLoad();
         fmTeacherLoad.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmTeacherLoad.TopLevel        = false;
         fmTeacherLoad.Dock            = DockStyle.Fill;
         TeacherLoadingWindow.Text     = fmTeacherLoad.Text;
         TeacherLoadingWindow.Controls.Add(fmTeacherLoad);
         this.radDock1.AddDocument(TeacherLoadingWindow);
         fmTeacherLoad.Show();
     }
     else
     {
         TeacherLoadingWindow.Show();
     }
     this.radDock1.ActiveWindow = TeacherLoadingWindow;
 }
Beispiel #7
0
 private void btnGradeSection_Click(object sender, EventArgs e)
 {
     if (GradeSectionDockWindow == null)
     {
         GradeSectionDockWindow             = new DocumentWindow();
         GradeSectionDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmGradeSectionList = new frmGradeSectionList();
         fmGradeSectionList.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmGradeSectionList.TopLevel        = false;
         fmGradeSectionList.Dock            = DockStyle.Fill;
         GradeSectionDockWindow.Text        = fmGradeSectionList.Text;
         GradeSectionDockWindow.Controls.Add(fmGradeSectionList);
         this.radDock1.AddDocument(GradeSectionDockWindow);
         fmGradeSectionList.Show();
     }
     else
     {
         GradeSectionDockWindow.Show();
     }
     this.radDock1.ActiveWindow = GradeSectionDockWindow;
 }
Beispiel #8
0
 private void btnFees_Click(object sender, EventArgs e)
 {
     if (StudentFeeDockWindow == null)
     {
         StudentFeeDockWindow             = new DocumentWindow();
         StudentFeeDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmStudentFeeList = new StudentFeeList();
         fmStudentFeeList.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmStudentFeeList.TopLevel        = false;
         fmStudentFeeList.Dock            = DockStyle.Fill;
         StudentFeeDockWindow.Text        = fmStudentFeeList.Text;
         StudentFeeDockWindow.Controls.Add(fmStudentFeeList);
         this.radDock1.AddDocument(StudentFeeDockWindow);
         fmStudentFeeList.Show();
     }
     else
     {
         StudentFeeDockWindow.Show();
     }
     this.radDock1.ActiveWindow = StudentFeeDockWindow;
 }
Beispiel #9
0
 private void btnCurriculum_Click(object sender, EventArgs e)
 {
     if (CurriculumDockWindow == null)
     {
         CurriculumDockWindow             = new DocumentWindow();
         CurriculumDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmManageCurriculum = new frmManageCurriculum();
         fmManageCurriculum.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmManageCurriculum.TopLevel        = false;
         fmManageCurriculum.Dock            = DockStyle.Fill;
         CurriculumDockWindow.Text          = fmManageCurriculum.Text;
         CurriculumDockWindow.Controls.Add(fmManageCurriculum);
         this.radDock1.AddDocument(CurriculumDockWindow);
         fmManageCurriculum.Show();
     }
     else
     {
         CurriculumDockWindow.Show();
     }
     this.radDock1.ActiveWindow = CurriculumDockWindow;
 }
Beispiel #10
0
 private void btnTimeSlot_Click(object sender, EventArgs e)
 {
     if (TimeslotDockWindow == null)
     {
         TimeslotDockWindow             = new DocumentWindow();
         TimeslotDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmTimeSlotList = new frmTimeSlotList();
         fmTimeSlotList.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmTimeSlotList.TopLevel        = false;
         fmTimeSlotList.Dock            = DockStyle.Fill;
         TimeslotDockWindow.Text        = fmTimeSlotList.Text;
         TimeslotDockWindow.Controls.Add(fmTimeSlotList);
         this.radDock1.AddDocument(TimeslotDockWindow);
         fmTimeSlotList.Show();
     }
     else
     {
         TimeslotDockWindow.Show();
     }
     this.radDock1.ActiveWindow = TimeslotDockWindow;
 }
Beispiel #11
0
 private void btnLearningArea_Click(object sender, EventArgs e)
 {
     if (LearningAreaDockWindow == null)
     {
         LearningAreaDockWindow             = new DocumentWindow();
         LearningAreaDockWindow.CloseAction = DockWindowCloseAction.Close;
         fmLearningAreas = new frmLearningAreas();
         fmLearningAreas.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         fmLearningAreas.TopLevel        = false;
         fmLearningAreas.Dock            = DockStyle.Fill;
         LearningAreaDockWindow.Text     = fmLearningAreas.Text;
         LearningAreaDockWindow.Controls.Add(fmLearningAreas);
         this.radDock1.AddDocument(LearningAreaDockWindow);
         fmLearningAreas.Show();
     }
     else
     {
         LearningAreaDockWindow.Show();
     }
     this.radDock1.ActiveWindow = LearningAreaDockWindow;
 }
Beispiel #12
0
        public void ChangeToDocumentView()
        {
            DocumentWindow document = new DocumentWindow();

            document.Show();
        }
Beispiel #13
0
        /// <summary>
        /// STARTING POINT for Open Document
        ///
        /// Order of Operations
        /// 1.) MainViewModel.OnOpenDocument
        /// 2.) DocumentWindow.OpenFile
        /// 3.) MainViewModel.AddDocument
        /// </summary>
        public static void OpenDocument(string path, Action callback = null)
        {
            #region InvokeRequired
            if (View.InvokeRequired)
            {
                View.Invoke(new Action <string, Action>(OpenDocument), path, callback);
                return;
            }
            #endregion

            PerformanceService.StartEvent($"{PerformanceService.CONST_OpenDocument}{path}");
            Log.WriteEnter(typeof(MainViewModel).FullName, MethodBase.GetCurrentMethod().Name);

            lock (_syncOpenDocument)
            {
                #region Check if already open
                if (!File.Exists(path))
                {
                    MessageBox.Show(string.Format("They system cannot find the file specified: \"{0}\"", path));
                    return;
                }
                var doc = FindDocument(path) as DocumentWindow;

                if (doc != null)
                {
                    doc.DockHandler.Show();

                    var model = doc as DocumentWindow;
                    if (model != null)
                    {
                        SetCurrent(model.ViewModel);
                    }

                    callback?.Invoke();
                    return;
                }
                #endregion

                #region Create DocumentWindow
                doc = new DocumentWindow {
                    Text = Path.GetFileName(path)
                };
                try
                {
                    var model = new DocumentModel
                    {
                        Control = doc.PrepareDocument(path),
                        File    = XmlDal.CacheModel.GetFile(path)
                    };

                    doc.ViewModel.View.StatusUpdate(StatusModel.Update("Loading"));
                    doc.ViewModel.Model      = model;
                    model.File.Options       = Options;
                    model.File.DocumentModel = model;
                    Documents.Add(doc.ViewModel);
                    DocumentService.BuildDocument(model);
                }
                catch (Exception exception) { doc.Close(); MessageBox.Show(exception.Message); }
                #endregion

                #region Show
                if (View.DockPanel.DocumentStyle == DocumentStyle.SystemMdi)
                {
                    doc.MdiParent = View as Form;
                    doc.Show();
                }
                else
                {
                    doc.Show(View.DockPanel);
                }
                #endregion

                if (StartupComplete)
                {
                    SetCurrent(doc.ViewModel);
                }

                callback?.Invoke();

                PerformanceService.StopEvent($"{PerformanceService.CONST_OpenDocument}{path}");
                Log.WriteExit(typeof(MainViewModel).FullName, MethodBase.GetCurrentMethod().Name);
            }
        }