Example #1
0
        /// <summary>
        /// Applies the state to the specified form.
        /// </summary>
        public void Apply(FrmMain form)
        {
            if (form == null)
            {
                throw new ArgumentNullException("form");
            }

            if (!IsEmpty && ScadaUiUtils.AreaIsVisible(Left, Top, Width, Height))
            {
                form.SetBounds(Left, Top, Width, Height);
                form.WindowState   = Maximized ? FormWindowState.Maximized : FormWindowState.Normal;
                form.ExplorerWidth = ExplorerWidth;
            }
        }
Example #2
0
        /// <summary>
        /// Применить состояние к заданной форме.
        /// </summary>
        public void Apply(Form form)
        {
            if (form == null)
            {
                throw new ArgumentNullException("form");
            }

            if (IsEmpty || !ScadaUiUtils.AreaIsVisible(Left, Top, Width, Height))
            {
                int adj = CalcFormAdj(form);
                form.Left   = -adj;
                form.Top    = BrowserToolbarHeight;
                form.Height = Math.Max(form.Height,
                                       Screen.FromControl(form).WorkingArea.Height + adj - BrowserToolbarHeight);
            }
            else
            {
                form.SetBounds(Left, Top, Width, Height);
            }
        }