public ViewEditorDialog (ISchemaProvider schemaProvider, bool create, ViewEditorSettings settings) { if (schemaProvider == null) throw new ArgumentNullException ("schemaProvider"); this.schemaProvider = schemaProvider; this.action = create ? SchemaActions.Create : SchemaActions.Alter; this.Build(); if (create) Title = AddinCatalog.GetString ("Create View"); else Title = AddinCatalog.GetString ("Alter View"); notebook = new Notebook (); sqlEditor = new SqlEditorWidget (); sqlEditor.TextChanged += new EventHandler (SqlChanged); notebook.AppendPage (sqlEditor, new Label (AddinCatalog.GetString ("Definition"))); if (settings.ShowComment) { commentEditor = new CommentEditorWidget (); notebook.AppendPage (commentEditor, new Label (AddinCatalog.GetString ("Comment"))); } notebook.Page = 0; entryName.Text = view.Name; vboxContent.PackStart (notebook, true, true, 0); vboxContent.ShowAll (); SetWarning (null); }
public bool ShowViewEditorDialog (IEditSchemaProvider schemaProvider, ViewSchema view, bool create) { ViewEditorSettings settings = new ViewEditorSettings (); ViewEditorDialog dlg = new ViewEditorDialog (schemaProvider, create, settings); dlg.Initialize (view); return RunDialog (dlg);
public ViewEditorDialog(ISchemaProvider schemaProvider, bool create, ViewEditorSettings settings) { if (schemaProvider == null) { throw new ArgumentNullException("schemaProvider"); } this.schemaProvider = schemaProvider; this.action = create ? SchemaActions.Create : SchemaActions.Alter; this.Build(); if (create) { Title = AddinCatalog.GetString("Create View"); } else { Title = AddinCatalog.GetString("Alter View"); } notebook = new Notebook(); sqlEditor = new SqlEditorWidget(); sqlEditor.TextChanged += new EventHandler(SqlChanged); notebook.AppendPage(sqlEditor, new Label(AddinCatalog.GetString("Definition"))); if (settings.ShowComment) { commentEditor = new CommentEditorWidget(); notebook.AppendPage(commentEditor, new Label(AddinCatalog.GetString("Comment"))); } notebook.Page = 0; entryName.Text = view.Name; vboxContent.PackStart(notebook, true, true, 0); vboxContent.ShowAll(); SetWarning(null); }