Exemple #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);
            }
        }
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormNewOgrDataset dlg = new FormNewOgrDataset();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ConfigConnections connStream = new ConfigConnections("OGR", "ca7011b3-0812-47b6-a999-98a900c4087d");

                string connectionString = dlg.ConnectionString;
                string id = "OGR Connection";
                id = connStream.GetName(id);

                connStream.Add(id, connectionString);
                //e.NewExplorerObject = new OGRExplorerObject(this.ParentExplorerObject, id, dbConnStr);
            }
        }
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            var dlg = new FormVectorTileCacheConnection();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ConfigConnections connStream = new ConfigConnections("VectorTileCache", "b9d6ae5b-9ca1-4a52-890f-caa4009784d4");

                string connectionString = dlg.ConnectionString;
                string id = dlg.VectorTileCacheName;
                id = connStream.GetName(id);

                connStream.Add(id, connectionString);
                e.NewExplorerObject = new VectorTileCacheDatasetExplorerObject(this.ParentExplorerObject, id, connectionString);
            }
        }
Exemple #4
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormEventTableConnection dlg = new FormEventTableConnection();

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

                EventTableConnection etconn = new EventTableConnection(
                    dlg.DbConnectionString,
                    dlg.TableName,
                    dlg.IdField, dlg.XField, dlg.YField,
                    dlg.SpatialReference);

                string id = connStream.GetName(dlg.TableName);
                connStream.Add(id, etconn.ToXmlString());

                e.NewExplorerObject = new EventTableObject(this.ParentExplorerObject, id, etconn);
            }
        }
Exemple #5
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);
            }
        }