Пример #1
0
        //public void BlockView() => (this as IBlockable)?.BlockView();
        //public void UnblockView() => (this as IBlockable)?.UnblockView();

        public static void loadTileFormExtraWindow(CanvasGrid canvasGrid, string WindowHeader, bool silent = false)
        {
            UI_CanvasForm extraForm;

            if (allExtraForms.ContainsKey(WindowHeader))
            {
                extraForm = allExtraForms[WindowHeader];

                foreach (Control ctr in extraForm?.Controls)
                {
                    if (ctr is UI_ComponentFormTile cft)
                    {
                        cft.ReAnchorToPanel();
                    }
                }
            }
            else
            {
                extraForm = new UI_CanvasForm(true);
                allExtraForms[WindowHeader] = extraForm;
                extraForms.Add(extraForm);
            }

            extraForm.Controls.Clear();
            extraForm.Text = WindowHeader;

            UICore.registerFormEvents(extraForm);
            UICore.registerHotkeyBlacklistControls(extraForm);
            loadTileForm(extraForm, canvasGrid);

            if (canvasGrid.isResizable)
            {
                extraForm.MaximizeBox     = true;
                extraForm.FormBorderStyle = FormBorderStyle.Sizable;
            }
            else
            {
                extraForm.MaximizeBox     = false;
                extraForm.FormBorderStyle = FormBorderStyle.FixedSingle;
            }


            if (!silent)
            {
                extraForm.Show();
                extraForm.Focus();
            }
        }