public WorkspaceItem AddNewWorkspaceItem (Workspace parentWorkspace, string defaultItemId) { NewProjectDialog npdlg = new NewProjectDialog (null, false, parentWorkspace.BaseDirectory); npdlg.SelectTemplate (defaultItemId); try { if (MessageService.RunCustomDialog (npdlg) == (int) Gtk.ResponseType.Ok && npdlg.NewItem != null) { parentWorkspace.Items.Add ((WorkspaceItem) npdlg.NewItem); Save (parentWorkspace); return (WorkspaceItem) npdlg.NewItem; } } finally { npdlg.Destroy (); } return null; }
public void NewSolution (string defaultTemplate) { NewProjectDialog pd = new NewProjectDialog (null, true, null); if (defaultTemplate != null) pd.SelectTemplate (defaultTemplate); MessageService.ShowCustomDialog (pd); }