Ejemplo n.º 1
0
        protected void OnConnected(DatabaseBase database)
        {
            // Add new connection to database treeview
            TreeIter iterDatabase = _treestoreDatabases.AppendValues(database.Name);
            TreeIter iterTables = _treestoreDatabases.AppendValues(iterDatabase, "Tables");
            var tables = database.GetTables();
            foreach(var table in tables)
                _treestoreDatabases.AppendValues(iterTables, table.Name);

            treeviewDatabase.Show();
            var page = notebookContent.CurrentPageWidget as QueryWidget;
            if(page==null)
                return;

            // Add new connection to connection list
            comboboxConnections.AppendText(String.Format("{0}@{1} ({2})",database.ConnectionData.Host,
                database.Name, database.Vendor));
            //var count = comboboxConnections.Model.IterNChildren();
            _connectionMapping.Add(database);
        }
Ejemplo n.º 2
0
 public static void AddDatabase(DatabaseBase database)
 {
     _databaseStore = _databaseStore ?? new Dictionary<int, DatabaseBase>();
     if(_databaseStore.ContainsValue(database))
         return;
     var id = _databaseStore.Count+1;
     database.Id=id;
     _databaseStore.Add(id,database);
 }