Esempio n. 1
0
        private FormBase SearchChildren(FormBase aForm)
        {
            FormBase res = aForm;

            if (this.MdiChildren.Length > 0)
            {
                foreach (Form children in this.MdiChildren)
                {
                    if (children.GetType().Equals(aForm.GetType()))
                    {
                        res = (FormBase)children;

                        if ((aForm is IFormDettaglio) &&
                            (children is IFormDettaglio))
                        {
                            // Gestisco i Dettagli aperti di ID Diveri
                            if (((IFormDettaglio)aForm).IdentificativoDettaglio != ((IFormDettaglio)children).IdentificativoDettaglio)
                            {
                                res = aForm;
                            }
                        }

                        //if (res)
                        //{
                        //    if (children.WindowState == FormWindowState.Minimized)
                        //    {
                        //        children.WindowState = FormWindowState.Normal;
                        //    }
                        //    children.Activate();
                        //    break;
                        //}
                        //if (res)
                        //{
                        //    children.Select();
                        break;
                        //}
                    }
                }
            }
            return(res);
        }
Esempio n. 2
0
        private bool mdiFormAperta(FormBase aForm)
        {
            bool res = false;

            if (this.MdiChildren.Length > 0)
            {
                foreach (Form children in this.MdiChildren)
                {
                    if (children.GetType().Equals(aForm.GetType()))
                    {
                        res = true;

                        if ((aForm is IFormDettaglio) &&
                            (children is IFormDettaglio))
                        {
                            if (((IFormDettaglio)aForm).IdentificativoDettaglio != ((IFormDettaglio)children).IdentificativoDettaglio)
                            {
                                res = false;
                            }
                        }

                        //if (res)
                        //{
                        //    if (children.WindowState == FormWindowState.Minimized)
                        //    {
                        //        children.WindowState = FormWindowState.Normal;
                        //    }
                        //    children.Activate();
                        //    break;
                        //}
                        if (res)
                        {
                            children.Select();
                            break;
                        }
                    }
                }
            }
            return(res);
        }
Esempio n. 3
0
        private FormBase SearchChildren(FormBase aForm)
        {
            FormBase res = aForm;
            if (this.MdiChildren.Length > 0)
            {
                foreach (Form children in this.MdiChildren)
                {
                    if (children.GetType().Equals(aForm.GetType()))
                    {
                        res = (FormBase)children;

                        if ((aForm is IFormDettaglio) &&
                            (children is IFormDettaglio))
                        {
                            // Gestisco i Dettagli aperti di ID Diveri
                            if (((IFormDettaglio)aForm).IdentificativoDettaglio != ((IFormDettaglio)children).IdentificativoDettaglio)
                            {
                                res = aForm;
                            }
                        }

                        //if (res)
                        //{
                        //    if (children.WindowState == FormWindowState.Minimized)
                        //    {
                        //        children.WindowState = FormWindowState.Normal;
                        //    }
                        //    children.Activate();
                        //    break;
                        //}
                        //if (res)
                        //{
                        //    children.Select();
                        break;
                        //}
                    }
                }
            }
            return res;
        }
Esempio n. 4
0
        private bool mdiFormAperta(FormBase aForm)
        {
            bool res = false;
            if (this.MdiChildren.Length > 0)
            {
                foreach (Form children in this.MdiChildren)
                {
                    if (children.GetType().Equals(aForm.GetType()))
                    {
                        res = true;

                        if ((aForm is IFormDettaglio) &&
                            (children is IFormDettaglio))
                        {
                            if (((IFormDettaglio)aForm).IdentificativoDettaglio != ((IFormDettaglio)children).IdentificativoDettaglio)
                            {
                                res = false;
                            }
                        }

                        //if (res)
                        //{
                        //    if (children.WindowState == FormWindowState.Minimized)
                        //    {
                        //        children.WindowState = FormWindowState.Normal;
                        //    }
                        //    children.Activate();
                        //    break;
                        //}
                        if (res)
                        {
                            children.Select();
                            break;
                        }
                    }
                }
            }
            return res;
        }