Esempio n. 1
0
 public void CloseForm(BuzzleGlobalView thisForm)
 {
     if (FormIsOpen(thisForm))
     {
         var form = GetOpenForm(thisForm);
         RemoveNavBarItem(form);
         OpenForms.Remove(form);
     }
     UnSetAsCurrentForm(thisForm);
     thisForm.Close();
     FormClosed(this, new FormManagerEventArgs(thisForm));
 }
Esempio n. 2
0
 private void ShowForm(BuzzleGlobalView thisForm)
 {
     ClearScreen();
     if (thisForm == null)
     {
         return;
     }
     this.IsMdiContainer = true;
     thisForm.TopLevel = false;
     panel_Display.Controls.Add(thisForm);
     thisForm.FormBorderStyle = FormBorderStyle.None;
     thisForm.Dock = DockStyle.Fill;
     thisForm.Show();
 }
Esempio n. 3
0
 public BuzzleNavBarItem(BuzzleGlobalView targetForm)
 {
     TargetForm = targetForm;
 }
Esempio n. 4
0
 public BuzzleNavBarItem(BuzzleGlobalView targetForm)
 {
     TargetForm = targetForm;
     Caption = targetForm.Text;
 }
Esempio n. 5
0
 public FormManagerEventArgs(BuzzleGlobalView thisForm)
 {
     FormInQuestion = thisForm;
 }
Esempio n. 6
0
        public void OpenForm(BuzzleGlobalView thisForm, bool CloseAnyExistingInstance = false)
        {
            //If the form is not already open, open it, case closed.
            if (FormIsOpen(thisForm) != true)
            {
                LoadNewForm(thisForm);
                return;
            }

            //If the form is already open and we did not
            //specify to close existing instances, just load the existing instance
            //on the screen. Easy right?
            if (CloseAnyExistingInstance == false)
            {
                SetAsCurrentForm(thisForm);
                return;
            }

            //Finally, if the above are all not satisfied, then it is clear
            //what must be done, kill the existing instance and load a fresh one
            CloseForm(thisForm);
            LoadNewForm(thisForm);
        }
Esempio n. 7
0
 public bool IsCurrentForm(BuzzleGlobalView thisForm)
 {
     return thisForm.IsCurrentForm;
 }
Esempio n. 8
0
 public bool FormIsOpen(BuzzleGlobalView thisForm)
 {
     return OpenForms.Any(form => form.Name == thisForm.Name);
 }
Esempio n. 9
0
 private void LoadNewForm(BuzzleGlobalView thisForm)
 {
     AddNavBarItem(thisForm);
     OpenForms.Add(thisForm);
     SetAsCurrentForm(thisForm);
     FormAdded(this, new FormManagerEventArgs(thisForm));
 }
Esempio n. 10
0
 private void RemoveNavBarItem(BuzzleGlobalView thisForm)
 {
     var navBarItem = thisForm.NavBarLink;
     CurrentNavBarGroup.ItemLinks.Remove(navBarItem);
 }
Esempio n. 11
0
 private BuzzleGlobalView GetOpenForm(BuzzleGlobalView thisForm)
 {
     return OpenForms.FirstOrDefault(form => form.Name == thisForm.Name);
 }
Esempio n. 12
0
 private void AddNavBarItem(BuzzleGlobalView thisForm)
 {
     var navBarItem = new BuzzleNavBarItem(thisForm);
     navBarItem.LinkClicked += NavBarItemClicked;
     thisForm.NavBarLink = navBarItem;
     CurrentNavBarGroup.ItemLinks.Add(navBarItem);
 }
Esempio n. 13
0
 public void UnSetAsCurrentForm(BuzzleGlobalView thisForm)
 {
     thisForm.IsCurrentForm = false;
     thisForm.NavBarLink.IsCurrent = false;
     CurrentFormChanged(this, new EventArgs());
 }
Esempio n. 14
0
 public void SetAsCurrentForm(BuzzleGlobalView passedForm)
 {
     var thisForm = GetOpenForm(passedForm);
     thisForm.IsCurrentForm = true;
     OpenForms.Where(form => form != thisForm).ForEach(form => form.IsCurrentForm = false);
     thisForm.NavBarLink.IsCurrent = true;
     UpdateNavBarAppearance(thisForm.NavBarLink);
     CurrentFormChanged(this, new EventArgs());
 }
Esempio n. 15
0
        public static void SwitchFocus(BuzzleGlobalView thisForm, DevExpress.XtraGrid.Views.Grid.GridView gridView = null)
        {
            if (thisForm.ActiveControl != null)
                thisForm.ActiveControl.SelectNextControl(thisForm.ActiveControl, true, true, false, true);
            else
                thisForm.SelectNextControl(thisForm, true, true, true, true);

            if (gridView != null)
            {
                gridView.CloseEditor();
                gridView.UpdateCurrentRow();
            }
        }