public WidgetInfo AddNewComponent(ComponentType type, string name) { object ob = ProjectBackend.AddNewWidget (type.Name, name); WidgetComponent wc = (WidgetComponent) App.GetComponent (ob, null, null); WidgetInfo wi = GetWidget (wc.Name); if (wi == null) { wi = new WidgetInfo (this, wc); widgets.Add (wi); } return wi; }