示例#1
0
        internal void OnMdiChildClosing(DockWindowCancelEventArgs e)
        {
            HostWindow host = e.NewWindow as HostWindow;

            if (host == null)
            {
                return;
            }

            Form form = host.MdiChild;

            if (form == null)
            {
                return;
            }

            this.suspendFormClear++;
            //explicitly call Close on the Form, many users have complained about their favourite Closing/Closed events missing
            form.Close();
            if (form.IsDisposed)
            {
                this.ClearForm(form, false);
            }
            else
            {
                e.Cancel = true;
            }
            this.suspendFormClear--;
        }
示例#2
0
        internal void OnFormRemoved(HostWindow sender, Form form)
        {
            if (!this.mdiChildren.Contains(form))
            {
                return;
            }

            this.ClearForm(form, false);
            sender.Close();
        }