Exemplo n.º 1
0
 public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
 {
     if (DeleteDataset(_dsname))
     {
         if (ExplorerObjectDeleted != null)
         {
             ExplorerObjectDeleted(this);
         }
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigTextStream stream = new ConfigTextStream("MsSql2008SpatialSde_connections", true, true);

            stream.Remove(this.Name, _connectionString);
            stream.Close();
            if (ExplorerObjectDeleted != null)
            {
                ExplorerObjectDeleted(this);
            }
            return(true);
        }
Exemplo n.º 3
0
        public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigTextStream stream = new ConfigTextStream("MsSql2008SpatialGeography_connections", true, true);

            stream.Remove(this.Name, _connectionString);
            stream.Close();
            if (ExplorerObjectDeleted != null)
            {
                ExplorerObjectDeleted(this);
            }
            return(Task.FromResult(true));
        }
Exemplo n.º 4
0
        public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigConnections stream = new ConfigConnections("TileCache", "b9d6ae5b-9ca1-4a52-890f-caa4009784d4");

            stream.Remove(_name);

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

            return(Task.FromResult(true));
        }
Exemplo n.º 5
0
        public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            ConfigConnections stream = new ConfigConnections("OGR", "ca7011b3-0812-47b6-a999-98a900c4087d");

            stream.Remove(_name);

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

            return(Task.FromResult(true));
        }
Exemplo n.º 6
0
        async public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            if (await DeleteDataset(_dsname))
            {
                if (ExplorerObjectDeleted != null)
                {
                    ExplorerObjectDeleted(this);
                }

                return(true);
            }
            return(false);
        }
Exemplo n.º 7
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));
        }
Exemplo n.º 8
0
        private void treeView_DoubleClick(object sender, EventArgs e)
        {
            TreeNode node = treeView.GetNodeAt(mouseX, mouseY);

            if (node is ExplorerObjectNode)
            {
                if (((ExplorerObjectNode)node).ExplorerObject is IExplorerObjectDoubleClick)
                {
                    ExplorerObjectEventArgs args = new ExplorerObjectEventArgs();
                    //args.Node = (ExplorerObjectNode)node;
                    ((IExplorerObjectDoubleClick)((ExplorerObjectNode)node).ExplorerObject).ExplorerObjectDoubleClick(args);
                }
            }
        }
Exemplo n.º 9
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormNewConnection dlg = new FormNewConnection();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string           connStr = dlg.ConnectionString;
                ConfigTextStream stream  = new ConfigTextStream("GeoServices_connections", true, true);
                string           id      = ConfigTextStream.ExtractValue(connStr, "server").UrlToConfigId();
                stream.Write(connStr, ref id);
                stream.Close();

                e.NewExplorerObject = new GeoServicesConnectionExplorerObject(this.ParentExplorerObject, id, dlg.ConnectionString);
            }
        }
Exemplo n.º 10
0
 public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
 {
     if (_dataset != null)
     {
         if (_dataset.Delete())
         {
             if (ExplorerObjectDeleted != null)
             {
                 ExplorerObjectDeleted(this);
             }
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 11
0
 public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
 {
     if (_dataset != null)
     {
         if (_dataset.Delete())
         {
             if (ExplorerObjectDeleted != null)
             {
                 ExplorerObjectDeleted(this);
             }
             return(Task.FromResult(true));
         }
     }
     return(Task.FromResult(false));
 }
Exemplo n.º 12
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);
            }
        }
Exemplo n.º 13
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);
            }
        }
 public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
 {
     if (_parent == null)
     {
         return(false);
     }
     if (_parent.DeleteFeatureClass(_fcname))
     {
         if (ExplorerObjectDeleted != null)
         {
             ExplorerObjectDeleted(this);
         }
         return(true);
     }
     return(false);
 }
Exemplo n.º 15
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormLocalCacheProperties dlg = new FormLocalCacheProperties();

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

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

                //connStream.Add(id, connectionString);
                //e.NewExplorerObject = new TileCacheDatasetExplorerObject(this.ParentExplorerObject, id, connectionString);
            }
        }
Exemplo n.º 16
0
        private void CheckExplorerObjectEventArgs(ExplorerObjectEventArgs args)
        {
            if (args.NewExplorerObject != null)
            {
                int          imageIndex = gView.Explorer.UI.Framework.UI.ExplorerIcons.ImageIndex(args.NewExplorerObject);
                string[]     texts      = { args.NewExplorerObject.Name, args.NewExplorerObject.Type };
                ListViewItem item       = new ExplorerObjectListViewItem(texts, args.NewExplorerObject);
                item.ImageIndex = imageIndex;

                listView.Items.Add(item);
                if (_tree != null)
                {
                    _tree.AddChildNode(args.NewExplorerObject);
                }
            }
        }
        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);
            }
        }
Exemplo n.º 18
0
        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);
            }
        }
Exemplo n.º 19
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);
        }
Exemplo n.º 20
0
 public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
 {
     try
     {
         FileInfo fi = new FileInfo(_filename);
         fi.Delete();
         if (ExplorerObjectDeleted != null)
         {
             ExplorerObjectDeleted(this);
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return(false);
     }
 }
Exemplo n.º 21
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormNewConnection dlg = new FormNewConnection();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string           connStr = dlg.ConnectionString;
                ConfigTextStream stream  = new ConfigTextStream("ArcIMS_connections", true, true);
                string           id      = ConfigTextStream.ExtractValue(connStr, "server");
                if (id.IndexOf(":") != -1)
                {
                    id = id.Replace(":", " (Port=") + ")";
                }
                stream.Write(connStr, ref id);
                stream.Close();

                e.NewExplorerObject = new ArcIMSConnectionExplorerObject(this.ParentExplorerObject, id, dlg.ConnectionString);
            }
        }
Exemplo n.º 22
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);
            }
        }
Exemplo n.º 23
0
 public bool DeleteExplorerObject(ExplorerObjectEventArgs e)
 {
     if (_parent.Object is IFeatureDatabase)
     {
         if (((IFeatureDatabase)_parent.Object).DeleteFeatureClass(this.Name))
         {
             if (ExplorerObjectDeleted != null)
             {
                 ExplorerObjectDeleted(this);
             }
             return(true);
         }
         else
         {
             MessageBox.Show("ERROR: " + ((IFeatureDatabase)_parent.Object).lastErrorMsg);
             return(false);
         }
     }
     return(false);
 }
Exemplo n.º 24
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);
            }
        }
Exemplo n.º 25
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormNewConnection dlg = new FormNewConnection();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string connStr = dlg.ConnectionString;
                if (connStr == String.Empty)
                {
                    return;
                }

                string id = String.Empty;
                switch (ConfigTextStream.ExtractValue(connStr, "service").ToUpper())
                {
                case "WMS_WFS":
                case "WMS":
                    Uri wmsUri = new Uri(ConfigTextStream.ExtractValue(connStr, "wms"));
                    id = wmsUri.Host;
                    break;

                case "WFS":
                    Uri wfsUri = new Uri(ConfigTextStream.ExtractValue(connStr, "wfs"));
                    id = wfsUri.Host;
                    break;

                default:
                    return;
                }
                if (dlg.ServiceName != String.Empty)
                {
                    id = dlg.ServiceName + "@" + id;
                }

                ConfigTextStream stream = new ConfigTextStream("ogc_connections", true, true);
                stream.Write(connStr, ref id);
                stream.Close();

                e.NewExplorerObject = new WMSServiceExplorerObject(_parent, id, dlg.ConnectionString);
            }
        }
Exemplo n.º 26
0
        public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            //ConfigTextStream stream = new ConfigTextStream("postgis_connections", true, true);
            //stream.Remove(this.Name, _connectionString);
            //stream.Close();
            //if (ExplorerObjectDeleted != null) ExplorerObjectDeleted(this);
            //return true;

            bool ret = false;

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

            if (ret && ExplorerObjectDeleted != null)
            {
                ExplorerObjectDeleted(this);
            }
            return(Task.FromResult(ret));
        }
Exemplo n.º 27
0
        async public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            var instance = await this.GetInstanceAsync();

            if (instance is IFeatureDatabase)
            {
                if (await((IFeatureDatabase)instance).DeleteFeatureClass(this.Name))
                {
                    if (ExplorerObjectDeleted != null)
                    {
                        ExplorerObjectDeleted(this);
                    }
                    return(true);
                }
                else
                {
                    MessageBox.Show("ERROR: " + ((IFeatureDatabase)instance).LastErrorMessage);
                    return(false);
                }
            }
            return(false);
        }
Exemplo n.º 28
0
        public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e)
        {
            FormConnectionString dlg = new FormConnectionString();

            dlg.ProviderID = "arcsde";
            dlg.UseProviderInConnectionString = true;

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string connStr = dlg.ConnectionString;
                if (connStr.ToLower().StartsWith("sde:"))
                {
                    connStr = connStr.Substring(4, connStr.Length - 4);
                }

                ConfigTextStream stream   = new ConfigTextStream("sde_connections", true, true);
                string           id       = ConfigTextStream.ExtractValue(connStr, "server").Replace(":", "_").Replace(@"\", "_");
                string           instance = ConfigTextStream.ExtractValue(connStr, "instance").Replace(":", "_").Replace(@"\", "_");
                string           database = ConfigTextStream.ExtractValue(connStr, "database").Replace(":", "_").Replace(@"\", "_");

                if (String.IsNullOrEmpty(id))
                {
                    id = "ArcSDE Connection";
                }
                if (!String.IsNullOrEmpty(instance))
                {
                    id += "-" + instance;
                }
                if (!String.IsNullOrEmpty(database))
                {
                    id += "-" + database;
                }

                stream.Write(connStr, ref id);
                stream.Close();

                e.NewExplorerObject = new SdeExplorerObject(this.ParentExplorerObject, id, dlg.ConnectionString);
            }
        }
Exemplo n.º 29
0
        async void _deleteMenuItem_Click(object sender, EventArgs e)
        {
            if (_contextNode is ExplorerObjectNode)
            {
                TreeNode parent = ((TreeNode)_contextNode).Parent;

                IExplorerObject exObject = _contextNode.ExplorerObject;
                if (exObject is IExplorerObjectDeletable)
                {
                    ExplorerObjectEventArgs args = new ExplorerObjectEventArgs();
                    //args.Node = _contextNode;
                    if (await((IExplorerObjectDeletable)exObject).DeleteExplorerObject(args))
                    {
                        int pos = -1;
                        if (parent != null)
                        {
                            pos = ((TreeNode)_contextNode).Parent.Nodes.IndexOf(_contextNode);
                            parent.Nodes.Remove(_contextNode);
                        }
                        else
                        {
                            pos = treeView.Nodes.IndexOf(_contextNode);
                            treeView.Nodes.Remove(_contextNode);
                        }
                        if (pos != -1 && NodeDeleted != null)
                        {
                            NodeDeleted(_contextNode.ExplorerObject);
                        }
                    }
                }

                if (parent != null && parent.Nodes.Count == 0)
                {
                    parent.Nodes.Add(new DummyNode());
                    parent.Collapse();
                }
                _contextNode = null;
            }
        }
Exemplo n.º 30
0
        public Task <bool> DeleteExplorerObject(ExplorerObjectEventArgs e)
        {
            //ConfigTextStream stream = new ConfigTextStream("postgis_connections", true, true);
            //stream.Remove(this.Name, _connectionString);
            //stream.Close();
            //if (ExplorerObjectDeleted != null) ExplorerObjectDeleted(this);
            //return true;

            bool ret = false;

            if (_connectionString != null)
            {
                ConfigConnections stream = new ConfigConnections(GeoJsonServiceGroupObject.ConfigName, GeoJsonServiceGroupObject.EncKey);
                ret = stream.Remove(_name);
            }

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

            return(Task.FromResult(ret));
        }