public static WidgetContainer CreateWidgetPanel(BindingForm form) { if (form.GUIContainerId < 0) { // Non è stato ancora creato il pannello relativo al widget WidgetContainer widgetContainer = new WidgetContainer(form); form.GUIContainerId = widgetContainer.ID; widgetContainer.Text = "Form " + form.Id; widgetContainer.Show(GuiManager.dockPanel, DockState.DockRight); WidgetContainersList.Add(widgetContainer); return(widgetContainer); } else { //Search for the WidgetContainer with GUIContainerId WidgetContainer container = WidgetContainersList.Find(obj => obj.ID == form.GUIContainerId); //container.Focus(); container.Show(); return(container); } }