Esempio n. 1
0
        IWindowControl IWindowControl.GetTopLevelControl()
        {
            //TODO: review here again
            Form    form1 = control.FindForm();
            Control realTopLevelWindowControl = control.TopLevelControl;

            realTopLevelWindowControl = form1;
            ///MoonTrip version
            ///for use in extensions custom tool
            ///Form in ToolWindow is can not top level
            ///create some fake Form to TopLevelControl
            if (realTopLevelWindowControl == null)
            {
                realTopLevelWindowControl = new Form();
            }
            if (topLevelWindowControl == null ||
                topLevelWindowControl.control != realTopLevelWindowControl)
            {
                return(topLevelWindowControl = (realTopLevelWindowControl is Form) ?
                                               (MyWindowControl)MyWindowForm.TryGetWindowControlOrRegisterIfNotExists((Form)realTopLevelWindowControl) :
                                               MyWindowControl.TryGetWindowControlOrRegisterIfNotExists(realTopLevelWindowControl));
            }

            return(topLevelWindowControl);
        }
Esempio n. 2
0
        IWindowControl IWindowControl.GetTopLevelControl()
        {
            //TODO: review here again
            Control realTopLevelWindowControl = control.TopLevelControl;

            if (topLevelWindowControl == null ||
                topLevelWindowControl.control != realTopLevelWindowControl)
            {
                return(topLevelWindowControl = (realTopLevelWindowControl is Form) ?
                                               (MyWindowControl)MyWindowForm.TryGetWindowControlOrRegisterIfNotExists((Form)realTopLevelWindowControl) :
                                               MyWindowControl.TryGetWindowControlOrRegisterIfNotExists(realTopLevelWindowControl));
            }

            return(topLevelWindowControl);
        }