コード例 #1
0
ファイル: NavBar.cs プロジェクト: windygu/WMS_WinForms
        /// <summary>
        /// Навигира към подчинена форма в нов прозорец
        /// </summary>
        /// <param name="form"></param>
        /// <param name="parent"></param>
        public static void Navigate(Form form, Control parent, Control fromForm = null, bool New_window = false)
        {
            form.TopLevel        = false;
            form.Dock            = DockStyle.Fill;
            form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            form.Parent          = parent.Parent;

            form.WindowState = FormWindowState.Maximized;
            Form       parent_form = (Form)parent.Parent;
            RadDock    radDock1    = (RadDock)parent_form.Controls["RadDock1"];
            HostWindow host        = radDock1.GetHostWindow(fromForm);

            foreach (HostWindow item in radDock1.GetWindows <HostWindow>())
            {
                if (item.Text == form.Text || item.Text == fromForm.Text)
                {
                    if (!New_window)
                    {
                        item.Close();
                    }
                }
            }

            radDock1.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.ToBack;
            if (!New_window)
            {
                host.Close();
                radDock1.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.InFront;
            }

            radDock1.DockControl(form, DockPosition.Fill, DockType.Document);
            form.Show();
        }
コード例 #2
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (GlobalDataUtil.GetInstance().Browser != null)
            {
                GlobalDataUtil.GetInstance().Browser.Close();
            }

            hostWindow.Close();
        }
コード例 #3
0
        private void Window_Closed(object sender, EventArgs e)
        {
            if (GlobalDataUtil.GetInstance().Browser != null)
            {
                GlobalDataUtil.GetInstance().Browser.Close();
            }

            hostWindow.Close();
        }
コード例 #4
0
 private void OnRestartClick(object sender, RoutedEventArgs e)
 {
     ElevateResult = true;
     HostWindow.Close();
 }
コード例 #5
0
 private void OnClick(object sender, RoutedEventArgs args)
 {
     HostWindow?.Close();
 }