public ProcedureEditorDialog(IEditSchemaProvider schemaProvider, bool create, ProcedureEditorSettings settings)
        {
            if (schemaProvider == null)
            {
                throw new ArgumentNullException("schemaProvider");
            }

            this.settings       = settings;
            this.schemaProvider = schemaProvider;
            this.action         = create ? SchemaActions.Create : SchemaActions.Alter;

            this.Build();

            if (create)
            {
                Title = AddinCatalog.GetString("Create Procedure");
            }
            else
            {
                Title = AddinCatalog.GetString("Alter Procedure");
            }

            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")));
            }

            if (!settings.ShowName)
            {
                nameLabel.Visible = false;
                entryName.Visible = false;
            }

            vboxContent.PackStart(notebook, true, true, 0);
            vboxContent.ShowAll();
            SetWarning(null);
        }
Exemplo n.º 2
0
		public ProcedureEditorDialog (IEditSchemaProvider schemaProvider, bool create, ProcedureEditorSettings settings)
		{
			if (schemaProvider == null)
				throw new ArgumentNullException ("schemaProvider");
			
			this.settings = settings;
			this.schemaProvider = schemaProvider;
			this.action = create ? SchemaActions.Create : SchemaActions.Alter;
			
			this.Build();
			
			if (create)
				Title = AddinCatalog.GetString ("Create Procedure");
			else
				Title = AddinCatalog.GetString ("Alter Procedure");
			
			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")));
			}
			
			if (!settings.ShowName) {
				nameLabel.Visible = false;
				entryName.Visible = false;
			}

			vboxContent.PackStart (notebook, true, true, 0);
			vboxContent.ShowAll ();
			SetWarning (null);
		}
Exemplo n.º 3
0
		public bool ShowProcedureEditorDialog (IEditSchemaProvider schemaProvider, ProcedureSchema procedure, bool create)
		{
			ProcedureEditorSettings settings = new ProcedureEditorSettings ();
			ProcedureEditorDialog dlg = new ProcedureEditorDialog (schemaProvider, create, settings);
			dlg.Initialize (procedure);

			return RunDialog (dlg);