Exemple #1
0
        async public override Task <bool> Refresh()
        {
            await base.Refresh();

            base.AddChildObject(new PostGISNewConnectionObject(this));

            //ConfigTextStream stream = new ConfigTextStream("postgis_connections");
            //string connStr, id;
            //while ((connStr = stream.Read(out id)) != null)
            //{
            //    base.AddChildObject(new PostGISExplorerObject(id, connStr));
            //}
            //stream.Close();

            ConfigConnections           conStream           = new ConfigConnections("postgis", "546B0513-D71D-4490-9E27-94CD5D72C64A");
            Dictionary <string, string> DbConnectionStrings = conStream.Connections;

            foreach (string DbConnName in DbConnectionStrings.Keys)
            {
                DbConnectionString dbConn = new DbConnectionString();
                dbConn.FromString(DbConnectionStrings[DbConnName]);
                base.AddChildObject(new PostGISExplorerObject(this, DbConnName, dbConn));
            }

            return(true);
        }
Exemple #2
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);
            }
        }
Exemple #3
0
        public Task <bool> RenameExplorerObject(string newName)
        {
            //bool ret = false;
            //ConfigTextStream stream = new ConfigTextStream("postgis_connections", true, true);
            //ret = stream.ReplaceHoleLine(ConfigTextStream.BuildLine(_server, _connectionString), ConfigTextStream.BuildLine(newName, _connectionString));
            //stream.Close();

            //if (ret == true)
            //{
            //    _server = newName;
            //    if (ExplorerObjectRenamed != null) ExplorerObjectRenamed(this);
            //}
            //return ret;

            bool ret = false;

            if (_connectionString != null)
            {
                ConfigConnections stream = new ConfigConnections("postgis", "546B0513-D71D-4490-9E27-94CD5D72C64A");
                ret = stream.Rename(_server, newName);
            }
            if (ret == true)
            {
                _server = newName;
                if (ExplorerObjectRenamed != null)
                {
                    ExplorerObjectRenamed(this);
                }
            }
            return(Task.FromResult(ret));
        }
Exemple #4
0
        void ConnectionProperties_Click(object sender, EventArgs e)
        {
            if (_etconn == null)
            {
                return;
            }

            FormEventTableConnection dlg = new FormEventTableConnection();

            dlg.DbConnectionString = _etconn.DbConnectionString;
            dlg.TableName          = _etconn.TableName;
            dlg.IdField            = _etconn.IdFieldName;
            dlg.XField             = _etconn.XFieldName;
            dlg.YField             = _etconn.YFieldName;
            dlg.SpatialReference   = _etconn.SpatialReference;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                EventTableConnection etcon = new EventTableConnection(
                    dlg.DbConnectionString,
                    dlg.TableName,
                    dlg.IdField, dlg.XField, dlg.YField,
                    dlg.SpatialReference);

                ConfigConnections connStream = new ConfigConnections("eventtable", "546B0513-D71D-4490-9E27-94CD5D72C64A");
                connStream.Add(dlg.TableName, etcon.ToXmlString());
                _etconn = etcon;
            }
        }
        void ConnectionProperties_Click(object sender, EventArgs e)
        {
            FormNewOgrDataset dlg = new FormNewOgrDataset(_connectionString);


            if (dlg.ShowDialog() == DialogResult.OK)
            {
                ConfigConnections connStream = new ConfigConnections("OGR", "ca7011b3-0812-47b6-a999-98a900c4087d");
                connStream.Add(_name, this.ConnectionString = dlg.ConnectionString);
            }
        }
        public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigConnections stream = new ConfigConnections("TileCache", "b9d6ae5b-9ca1-4a52-890f-caa4009784d4");

            stream.Remove(_name);

            if (ExplorerObjectDeleted != null)
            {
                ExplorerObjectDeleted(this);
            }
            return(true);
        }
        public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigConnections stream = new ConfigConnections("OGR", "ca7011b3-0812-47b6-a999-98a900c4087d");

            stream.Remove(_name);

            if (ExplorerObjectDeleted != null)
            {
                ExplorerObjectDeleted(this);
            }
            return(true);
        }
Exemple #8
0
        void ConnectionProperties_Click(object sender, EventArgs e)
        {
            FormTileCacheConnection dlg = new FormTileCacheConnection();

            dlg.ConnectionString = _connectionString;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                ConfigConnections connStream = new ConfigConnections("TileCache", "b9d6ae5b-9ca1-4a52-890f-caa4009784d4");
                connStream.Add(_name, this.ConnectionString = dlg.ConnectionString);
            }
        }
        private void addNetworkDirectory_Click(object sender, EventArgs e)
        {
            gView.Framework.UI.Dialogs.FormAddNetworkDirectory dlg = new gView.Framework.UI.Dialogs.FormAddNetworkDirectory();
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK && !String.IsNullOrEmpty(dlg.Path))
            {
                ConfigConnections connStream = new ConfigConnections("directories");
                connStream.Add(dlg.Path, dlg.Path);

                _tree.SelectRootNode();
                RefreshContents();
            }
        }
        public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigConnections configStream = new ConfigConnections("directories");

            configStream.Remove(this.Name);

            if (ExplorerObjectDeleted != null)
            {
                ExplorerObjectDeleted(this);
            }

            return(true);
        }
        public override void Refresh()
        {
            base.Refresh();
            base.AddChildObject(new OgrNewConnectionObject(this));


            ConfigConnections           conStream   = new ConfigConnections("OGR", "ca7011b3-0812-47b6-a999-98a900c4087d");
            Dictionary <string, string> connStrings = conStream.Connections;

            foreach (string connString in connStrings.Keys)
            {
                base.AddChildObject(new OgrDatasetExplorerObject(this, connString, connStrings[connString]));
            }
        }
Exemple #12
0
        public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigConnections stream = new ConfigConnections("eventtable", "546B0513-D71D-4490-9E27-94CD5D72C64A");
            bool ret = stream.Remove(_name);

            if (ret)
            {
                if (ExplorerObjectDeleted != null)
                {
                    ExplorerObjectDeleted(this);
                }
            }
            return(Task.FromResult(ret));
        }
        public override void Refresh()
        {
            base.Refresh();
            base.AddChildObject(new TileCacheNewConnectionObject(this));
            base.AddChildObject(new TileCacheLocalCacheProperties(this));

            ConfigConnections           conStream   = new ConfigConnections("TileCache", "b9d6ae5b-9ca1-4a52-890f-caa4009784d4");
            Dictionary <string, string> connStrings = conStream.Connections;

            foreach (string connString in connStrings.Keys)
            {
                base.AddChildObject(new TileCacheDatasetExplorerObject(this, connString, connStrings[connString]));
            }
        }
Exemple #14
0
        public override void Refresh()
        {
            base.Refresh();
            base.AddChildObject(new OracleNewConnectionObject(this));

            ConfigConnections           conStream           = new ConfigConnections("oracle", "546B0513-D71D-4490-9E27-94CD5D72C64A");
            Dictionary <string, string> DbConnectionStrings = conStream.Connections;

            foreach (string DbConnName in DbConnectionStrings.Keys)
            {
                DbConnectionString dbConn = new DbConnectionString();
                dbConn.FromString(DbConnectionStrings[DbConnName]);
                base.AddChildObject(new OracleExplorerObject(this, DbConnName, dbConn));
            }
        }
Exemple #15
0
        public void OnEvent(object MapEvent)
        {
            gView.Framework.UI.Dialogs.FormAddNetworkDirectory dlg = new gView.Framework.UI.Dialogs.FormAddNetworkDirectory();
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK && !String.IsNullOrEmpty(dlg.Path))
            {
                ConfigConnections connStream = new ConfigConnections("directories");
                connStream.Add(dlg.Path, dlg.Path);

                if (_exapp != null)
                {
                    //_tree.SelectRootNode();
                    _exapp.RefreshContents();
                }
            }
        }
Exemple #16
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormGeoJsonConnection dlg = new FormGeoJsonConnection();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string connectionString = dlg.ConnectionString;
                string name             = connectionString.ExtractConnectionStringParameter("target");

                ConfigConnections connStream = new ConfigConnections(GeoJsonServiceGroupObject.ConfigName, GeoJsonServiceGroupObject.EncKey);
                connStream.Add(name, connectionString);

                e.NewExplorerObject = new GeoJsonServiceExplorerObject(this.ParentExplorerObject, name, connectionString);
            }
        }
Exemple #17
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormMongoDbConnection dlg = new FormMongoDbConnection();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string connectionString = dlg.ConnectionString;
                string name             = connectionString.ExtractConnectionStringParameter("database");

                ConfigConnections connStream = new ConfigConnections("MongoDb", "546B0513-D71D-4490-9E27-94CD5D72C64A");
                connStream.Add(name, connectionString);

                e.NewExplorerObject = new MongoDbExplorerObject(this.ParentExplorerObject, name, connectionString);
            }
        }
Exemple #18
0
        public Task <bool> RenameExplorerObject(string newName)
        {
            ConfigConnections stream = new ConfigConnections("eventtable", "546B0513-D71D-4490-9E27-94CD5D72C64A");
            bool ret = stream.Rename(_name, newName);

            if (ret == true)
            {
                _name = newName;
                if (ExplorerObjectRenamed != null)
                {
                    ExplorerObjectRenamed(this);
                }
            }
            return(Task.FromResult(ret));
        }
Exemple #19
0
        public override void Refresh()
        {
            base.Refresh();

            base.AddChildObject(new EventTableNewConnectionObject(this));

            ConfigConnections           conStream           = new ConfigConnections("eventtable", "546B0513-D71D-4490-9E27-94CD5D72C64A");
            Dictionary <string, string> DbConnectionStrings = conStream.Connections;

            foreach (string DbConnName in DbConnectionStrings.Keys)
            {
                EventTableConnection dbConn = new EventTableConnection();
                dbConn.FromXmlString(DbConnectionStrings[DbConnName]);
                base.AddChildObject(new EventTableObject(this, DbConnName, dbConn));
            }
        }
Exemple #20
0
        public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            bool ret = false;

            if (_connectionString != null)
            {
                ConfigConnections stream = new ConfigConnections("oracle", "546B0513-D71D-4490-9E27-94CD5D72C64A");
                ret = stream.Remove(_server);
            }

            if (ret && ExplorerObjectDeleted != null)
            {
                ExplorerObjectDeleted(this);
            }
            return(ret);
        }
        async public override Task <bool> Refresh()
        {
            await base.Refresh();

            base.AddChildObject(new VectorTileCacheNewConnectionObject(this));

            ConfigConnections           conStream   = new ConfigConnections("VectorTileCache", "b9d6ae5b-9ca1-4a52-890f-caa4009784d4");
            Dictionary <string, string> connStrings = conStream.Connections;

            foreach (string connString in connStrings.Keys)
            {
                base.AddChildObject(new VectorTileCacheDatasetExplorerObject(this, connString, connStrings[connString]));
            }

            return(true);
        }
        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 #24
0
        async public override Task <bool> Refresh()
        {
            await base.Refresh();

            base.AddChildObject(new MongoDbNewConnectionObject(this));

            ConfigConnections           conStream           = new ConfigConnections("MongoDb", "546B0513-D71D-4490-9E27-94CD5D72C64A");
            Dictionary <string, string> DbConnectionStrings = conStream.Connections;

            foreach (string name in DbConnectionStrings.Keys)
            {
                var connectionString = DbConnectionStrings[name];
                base.AddChildObject(new MongoDbExplorerObject(this, name, connectionString));
            }

            return(true);
        }
        public bool RenameExplorerObject(string newName)
        {
            bool ret = false;
            ConfigConnections stream = new ConfigConnections("OGR", "ca7011b3-0812-47b6-a999-98a900c4087d");

            ret = stream.Rename(_name, newName);

            if (ret == true)
            {
                _name = newName;
                if (ExplorerObjectRenamed != null)
                {
                    ExplorerObjectRenamed(this);
                }
            }
            return(ret);
        }
        public bool RenameExplorerObject(string newName)
        {
            bool ret = false;
            ConfigConnections stream = new ConfigConnections("TileCache", "b9d6ae5b-9ca1-4a52-890f-caa4009784d4");

            ret = stream.Rename(_name, newName);

            if (ret == true)
            {
                _name = newName;
                if (ExplorerObjectRenamed != null)
                {
                    ExplorerObjectRenamed(this);
                }
            }
            return(ret);
        }
Exemple #27
0
        async public override Task <bool> Refresh()
        {
            await base.Refresh();

            base.AddChildObject(new GeoJsonServiceNewConnectionObject(this));

            ConfigConnections           conStream           = new ConfigConnections(ConfigName, EncKey);
            Dictionary <string, string> DbConnectionStrings = conStream.Connections;

            foreach (string name in DbConnectionStrings.Keys)
            {
                var connectionString = DbConnectionStrings[name];
                base.AddChildObject(new GeoJsonServiceExplorerObject(this, name, connectionString));
            }

            return(true);
        }
Exemple #28
0
        void ConnectionProperties_Click(object sender, EventArgs e)
        {
            if (_connectionString == null)
            {
                return;
            }

            FormMongoDbConnection dlg = new FormMongoDbConnection();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string connectionString = dlg.ConnectionString;

                ConfigConnections connStream = new ConfigConnections("MongoDb", "546B0513-D71D-4490-9E27-94CD5D72C64A");
                connStream.Add(_name, connectionString);

                _connectionString = connectionString;
            }
        }
Exemple #29
0
        public Task <bool> RenameExplorerObject(string newName)
        {
            bool ret = false;

            if (_connectionString != null)
            {
                ConfigConnections stream = new ConfigConnections(GeoJsonServiceGroupObject.ConfigName, GeoJsonServiceGroupObject.EncKey);
                ret = stream.Rename(_name, newName);
            }
            if (ret == true)
            {
                _name = newName;
                if (ExplorerObjectRenamed != null)
                {
                    ExplorerObjectRenamed(this);
                }
            }
            return(Task.FromResult(ret));
        }
Exemple #30
0
        public bool RenameExplorerObject(string newName)
        {
            bool ret = false;

            if (_connectionString != null)
            {
                ConfigConnections stream = new ConfigConnections("oracle", "546B0513-D71D-4490-9E27-94CD5D72C64A");
                ret = stream.Rename(_server, newName);
            }
            if (ret == true)
            {
                _server = newName;
                if (ExplorerObjectRenamed != null)
                {
                    ExplorerObjectRenamed(this);
                }
            }
            return(ret);
        }