Ejemplo n.º 1
0
 protected override ConnectionSettingsWidget CreateConnectionSettingsWidget(IDbFactory factory)
 {
     connectionWidget = new ConnectionSettingsWidget(factory);
     connectionWidget.ShowSettings(factory.GetDefaultConnectionSettings());
     connectionWidget.EnableTestButton = false;
     return(connectionWidget);
 }
        public CreateDatabaseDialog(IDbFactory factory)
        {
            this.Build();

            settingsWidget = CreateConnectionSettingsWidget(factory);
            vboxConnection.PackStart(settingsWidget, true, true, 0);

            settingsWidget.NeedsValidation    += Validate;
            settingsWidget.EnableRefreshButton = false;

            ShowAll();
        }
        protected override ConnectionSettingsWidget CreateConnectionSettingsWidget(IDbFactory factory)
        {
            connectionWidget = new SqliteConnectionSettingsWidget(factory);
            connectionWidget.ShowSettings(factory.GetDefaultConnectionSettings());
            connectionWidget.EnableOpenButton = true;
            connectionWidget.EnableTestButton = false;

            DatabaseConnectionSettings settings = new DatabaseConnectionSettings(connectionWidget.ConnectionSettings);

            // Set a temp database to avoid exception of the default connection pool.
            settings.Database = System.IO.Path.GetTempFileName();
            // Create Context, Pool, Connection
            DatabaseConnectionContext ctx = new DatabaseConnectionContext(settings, true);

            ctx.ConnectionPool.Initialize();
            this.DatabaseConnection = ctx;
            return(connectionWidget);
        }