示例#1
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormConnectionString dlg = new FormConnectionString();

            dlg.ProviderID = "postgre";
            dlg.UseProviderInConnectionString = false;

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                DbConnectionString dbConnStr  = dlg.DbConnectionString;
                ConfigConnections  connStream = new ConfigConnections("postgis", "546B0513-D71D-4490-9E27-94CD5D72C64A");

                string connectionString = dbConnStr.ConnectionString;
                string id = ConfigTextStream.ExtractValue(connectionString, "database");
                id = connStream.GetName(id);
                connStream.Add(id, dbConnStr.ToString());

                e.NewExplorerObject = new PostGISExplorerObject(this.ParentExplorerObject, id, dbConnStr);

                //string connStr = dlg.ConnectionString;
                //ConfigTextStream stream = new ConfigTextStream("postgis_connections", true, true);
                //string id = ConfigTextStream.ExtractValue(connStr, "Database");
                //id += "@" + ConfigTextStream.ExtractValue(connStr, "Server");
                //if (id == "@") id = "PostGIS Connection";
                //stream.Write(connStr, ref id);
                //stream.Close();

                //e.NewExplorerObject = new PostGISExplorerObject(id, dlg.ConnectionString);
            }
        }
示例#2
0
 public void Save(IPersistStream stream)
 {
     stream.Save("dbconn", _dbConn.ToString());
     stream.Save("table", _table);
     stream.Save("idfield", _idField);
     stream.Save("xfield", _xField);
     stream.Save("yfield", _yField);
     if (_sRef != null)
     {
         stream.Save("sref", _sRef.ToXmlString());
     }
 }
示例#3
0
        private void getConnectionString_Click(object sender, EventArgs e)
        {
            DbConnectionString dbConnStr = new DbConnectionString();

            dbConnStr.FromString(txtConnectionString.Text);

            FormConnectionString dlg = new FormConnectionString(dbConnStr);

            dlg.UseProviderInConnectionString = true;

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                dbConnStr = dlg.DbConnectionString;
                txtConnectionString.Text = dbConnStr.ToString();
            }
        }
示例#4
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormConnectionString dlg = new FormConnectionString();

            dlg.ProviderID = "oracle";
            dlg.UseProviderInConnectionString = false;

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                DbConnectionString dbConnStr  = dlg.DbConnectionString;
                ConfigConnections  connStream = new ConfigConnections("oracle", "546B0513-D71D-4490-9E27-94CD5D72C64A");

                string connectionString = dbConnStr.ConnectionString;
                string id = ConfigTextStream.ExtractOracleValue(connectionString, "service_name") + "@" + ConfigTextStream.ExtractOracleValue(connectionString, "host");
                id = connStream.GetName(id);
                connStream.Add(id, dbConnStr.ToString());

                e.NewExplorerObject = new OracleExplorerObject(this.ParentExplorerObject, id, dbConnStr);
            }
        }
示例#5
0
        void ConnectionProperties_Click(object sender, EventArgs e)
        {
            if (_connectionString == null)
            {
                return;
            }

            FormConnectionString dlg = new FormConnectionString(_connectionString);

            dlg.ProviderID = "oracle";
            dlg.UseProviderInConnectionString = false;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                DbConnectionString dbConnStr = dlg.DbConnectionString;

                ConfigConnections connStream = new ConfigConnections("oracle", "546B0513-D71D-4490-9E27-94CD5D72C64A");
                connStream.Add(_server, dbConnStr.ToString());

                _connectionString = dbConnStr;
            }
        }