Beispiel #1
0
 void RemoveFormFromList(Views.WinForms.FormMain form)
 {
     lock (formLocker)
     {
         forms.RemoveAll(f => f == form);
     }
 }
Beispiel #2
0
        public void Show()
        {
            if (formMain != null)
            {
                return;
            }

            formMain = new Views.WinForms.FormMain(
                setting,
                pacServer,
                serverTracker);
            formMain.FormClosed += (s, a) => formMain = null;
        }
Beispiel #3
0
        public MenuCtrl(
            Services.FormMgr formMgrService,
            Views.WinForms.FormMain formMain,
            TabEditorCtrl editorCtrl,
            ToolStripMenuItem miNewWindow,
            ToolStripMenuItem miLoad,
            ToolStripMenuItem miSaveAs,
            ToolStripMenuItem miExit)
        {
            this.formMgrService = formMgrService;

            BindControls(formMain, editorCtrl);
            BindEvents(miNewWindow, miLoad, miSaveAs, miExit);
        }
Beispiel #4
0
        public void Show()
        {
            if (formMain != null)
            {
                return;
            }

            VgcApis.Misc.UI.Invoke(() =>
            {
                formMain = Views.WinForms.FormMain.CreateForm(
                    setting, pacServer, serverTracker);
                formMain.FormClosed += (s, a) => formMain = null;
                formMain.Show();
            });
        }
Beispiel #5
0
        public void CreateNewForm()
        {
            lock (formLocker)
            {
                var newForm = new Views.WinForms.FormMain(api, settings, luaServer, this);

                newForm.FormClosed += (s, a) =>
                {
                    var form = newForm; // capture
                    RemoveFormFromList(form);
                };

                forms.Add(newForm);
                newForm.Show();
            }
        }
Beispiel #6
0
 public void ShowFormMain()
 {
     lock (formLocker)
     {
         VgcApis.Misc.UI.Invoke(() =>
         {
             if (formMain == null)
             {
                 var form         = Views.WinForms.FormMain.CreateForm(settings, luaServer, this);
                 form.FormClosed += (s, a) =>
                 {
                     formMain = null;
                 };
                 formMain = form;
                 formMain.Show();
             }
             formMain.Activate();
         });
     }
 }
Beispiel #7
0
        public MenuCtrl(
            Services.FormMgr formMgrService,
            Views.WinForms.FormMain formMain,
            TabEditorCtrl editorCtrl,
            ToolStripMenuItem miNewWindow,
            ToolStripMenuItem miLoad,
            ToolStripMenuItem miSaveAs,
            ToolStripMenuItem miExit,

            TabControl tabControlMain)
        {
            this.formMgrService = formMgrService;

            this.editorCtrl     = editorCtrl;
            this.miNewWindow    = miNewWindow;
            this.miLoad         = miLoad;
            this.miSaveAs       = miSaveAs;
            this.miExit         = miExit;
            this.tabControlMain = tabControlMain;
            this.formMain       = formMain;
        }
Beispiel #8
0
 private void BindControls(Views.WinForms.FormMain formMain, TabEditorCtrl editorCtrl)
 {
     // binding
     this.editorCtrl = editorCtrl;
     this.formMain   = formMain;
 }