Ejemplo n.º 1
0
        public override IWindowForm CreateNewWindow(int width, int height)
        {
            Form form1 = new Form();

            form1.Width  = width;
            form1.Height = height;
            return(MyWindowForm.TryGetWindowFormOrRegisterIfNotExists(form1));
        }
Ejemplo n.º 2
0
        public static IWindowForm TryGetWindowFormOrRegisterIfNotExists(Form form)
        {
            MyWindowForm myWinForm;

            if (!registerControls.TryGetValue(form, out myWinForm))
            {
                //register new one
                myWinForm = new MyWindowForm(form);
                registerControls.Add(form, myWinForm);
            }
            return(myWinForm);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        public static MyWindowControl TryGetWindowControlOrRegisterIfNotExists(Control control)
        {
            if (control is Form)
            {
                return((MyWindowControl)MyWindowForm.TryGetWindowFormOrRegisterIfNotExists((Form)control));
            }
            MyWindowControl myWinControl;

            if (!registerControls.TryGetValue(control, out myWinControl))
            {
                //register new one
                myWinControl = new CefBridge.MyWindowControl(control);
                registerControls.Add(control, myWinControl);
            }
            return(myWinControl);
        }