public override IWindowForm CreateNewWindow(int width, int height) { Form form1 = new Form(); form1.Width = width; form1.Height = height; return(MyWindowForm.TryGetWindowFormOrRegisterIfNotExists(form1)); }
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); }
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); }
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); }