コード例 #1
0
        public SdeFeatureClassExplorerObject(SdeExplorerObject parent, IDatasetElement element)
            : base(parent, typeof(IFeatureClass))
        {
            if (element == null)
            {
                return;
            }

            _fcname = element.Title;
            _parent = parent;

            if (element.Class is IFeatureClass)
            {
                _fc = (IFeatureClass)element.Class;
                switch (_fc.GeometryType)
                {
                case geometryType.Envelope:
                case geometryType.Polygon:
                    _icon = new SdePolygonIcon();
                    _type = "Polygon Featureclass";
                    break;

                case geometryType.Multipoint:
                case geometryType.Point:
                    _icon = new SdePointIcon();
                    _type = "Point Featureclass";
                    break;

                case geometryType.Polyline:
                    _icon = new SdeLineIcon();
                    _type = "Polyline Featureclass";
                    break;
                }
            }
        }
コード例 #2
0
        public AccessFDBDatasetExplorerObject(IExplorerObject parent, string filename, string dsname)
            : base(parent, typeof(AccessFDBDataset))
        {
            _filename = filename;

            if (dsname.IndexOf("#") == 0)
            {
                _isImageDataset = true;
                dsname          = dsname.Substring(1, dsname.Length - 1);
                _icon           = new AccessFDBImageDatasetIcon();
            }
            else
            {
                _isImageDataset = false;
                _icon           = new AccessFDBDatasetIcon();
            }
            _dsname = dsname;

            _dataset = new AccessFDBDataset();
            _dataset.ConnectionString = "mdb=" + _filename + ";dsname=" + _dsname;
            _dataset.Open();

            _contextItems           = new ToolStripItem[2];
            _contextItems[0]        = new ToolStripMenuItem("Spatial Reference...");
            _contextItems[0].Click += new EventHandler(SpatialReference_Click);
            _contextItems[1]        = new ToolStripMenuItem("Shrink Spatial Indices...");
            _contextItems[1].Click += new EventHandler(ShrinkSpatialIndices_Click);
        }
コード例 #3
0
        internal WMSServiceExplorerObject(IExplorerParentObject parent, string name, string connectionString)
            : base(parent as IExplorerObject, typeof(WMSClass))
        {
            _name             = name;
            _connectionString = connectionString;

            switch (ConfigTextStream.ExtractValue(_connectionString, "service").ToUpper())
            {
            case "WMS":
                _type = "OGC WMS Service";
                break;

            case "WFS":
                _type = "OGC WFS Service";
                _icon = new WFSConnectionIcon();
                break;

            case "WMS_WFS":
                _type = "OGC WMS/WFS Service";
                _icon = new WMSWFSConnectionIcon();
                break;

            default:
                _type = "Unknown OGC Service Type!!";
                break;
            }
            _parent = parent;
        }
コード例 #4
0
        internal MapServerServiceExplorerObject(MapServerConnectionExplorerObject parent, string name, string connectionString, MapServiceType type)
            : base(parent, typeof(MapServerClass), 2)
        {
            _menuitems = new ToolStripItem[] {
                new ToolStripMenuItem("Pre-Render Tiles...", null, this.MapServerServiceExplorerObject_PreRenderTiles)
            };

            switch (_type = type)
            {
            case MapServiceType.MXL:
                _icon = new MapServiceIcon();
                break;

            case MapServiceType.SVC:
                _icon = new MapServiceIcon2();
                break;

            case MapServiceType.GDI:
                _icon = new MapServiceIcon3();
                break;
            }

            _name             = name;
            _connectionString = connectionString;
            _parent           = parent;
        }
コード例 #5
0
 internal TOCElementExplorerObject(IExplorerObject parent, ITOCElement element)
     : base(parent, typeof(ITOCElement), 2)
 {
     _parent  = parent;
     _element = element;
     _icon    = new MapDocumentExploererIcon(2);
 }
コード例 #6
0
        public OGRFeatureClassExplorerObject(IExplorerObject parent, string filename)
            : base(parent, typeof(FeatureClass))
        {
            _filename = filename;

            Dataset ds = new Dataset();

            ds.ConnectionString = filename;
            if (!ds.Open())
            {
                if (ds.lastErrorMsg != String.Empty)
                {
                    MessageBox.Show("ERROR:" + ds.lastErrorMsg);
                }

                return;
            }

            if (ds.Elements.Count == 1)
            {
                _fc = ds.Elements[0].Class as IFeatureClass;
            }

            if (_fc == null)
            {
                return;
            }

            switch (_fc.GeometryType)
            {
            case geometryType.Envelope:
            case geometryType.Polygon:
                _icon = new AccessFDBPolygonIcon();
                _type = "OGR Polygon Featureclass";
                break;

            case geometryType.Multipoint:
            case geometryType.Point:
                _icon = new AccessFDBPointIcon();
                _type = "OGR Point Featureclass";
                break;

            case geometryType.Polyline:
                _icon = new AccessFDBLineIcon();
                _type = "OGR Polyline Featureclass";
                break;
            }
        }
コード例 #7
0
ファイル: ExplorerIcons.cs プロジェクト: jugstalt/gViewGisOS
        private static int ImageIndex(IExplorerIcon icon)
        {
            lock (lockThis)
            {
                int imageIndex = -1;
                if (icon != null)
                {
                    if (!_iconIndices.TryGetValue(icon.GUID, out imageIndex))
                    {
                        int index = ExplorerImageList.List.CountImages;
                        _iconIndices.Add(icon.GUID, index);
                        ExplorerImageList.List.AddImage(icon.Image);
                        return index;
                    }

                }
                return imageIndex;
            }
        }
コード例 #8
0
        public PersonalGDBFeatureClassExplorerObject(PersonalGDBExplorerObject parent, string filename, IDatasetElement element)
            : base(parent, typeof(FeatureClass))
        {
            if (element == null)
            {
                return;
            }

            _parent   = parent;
            _filename = filename;
            _fcname   = element.Title;

            if (element.Class is IFeatureClass)
            {
                _fc = (IFeatureClass)element.Class;
                switch (_fc.GeometryType)
                {
                case geometryType.Envelope:
                case geometryType.Polygon:
                    _icon = new AccessFDBPolygonIcon();
                    _type = "Polygon Featureclass";
                    break;

                case geometryType.Multipoint:
                case geometryType.Point:
                    _icon = new AccessFDBPointIcon();
                    _type = "Point Featureclass";
                    break;

                case geometryType.Polyline:
                    _icon = new AccessFDBLineIcon();
                    _type = "Polyline Featureclass";
                    break;

                default:
                    _icon = new AccessFDBLineIcon();
                    _type = "Featureclass";
                    break;
                }
            }
        }
コード例 #9
0
        public MsSql2008SpatialGeographyFeatureClassExplorerObject(MsSql2008SpatialGeographyExplorerObject parent, IDatasetElement element)
            : base(parent, typeof(IFeatureClass), 1)
        {
            if (element == null || !(element.Class is IFeatureClass))
            {
                return;
            }

            _parent = parent;
            _fcname = element.Title;

            if (element.Class is IFeatureClass)
            {
                _fc = (IFeatureClass)element.Class;
                switch (_fc.GeometryType)
                {
                case geometryType.Envelope:
                case geometryType.Polygon:
                    _icon = new MsSql2008SpatialGeographyPolygonIcon();
                    _type = "Polygon Featureclass";
                    break;

                case geometryType.Multipoint:
                case geometryType.Point:
                    _icon = new MsSql2008SpatialGeographyPointIcon();
                    _type = "Point Featureclass";
                    break;

                case geometryType.Polyline:
                    _icon = new MsSql2008SpatialGeographyLineIcon();
                    _type = "Polyline Featureclass";
                    break;

                default:
                    _icon = new MsSql2008SpatialGeographyLineIcon();
                    _type = "Featureclass";
                    break;
                }
            }
        }
コード例 #10
0
        public AccessFDBFeatureClassExplorerObject(AccessFDBDatasetExplorerObject parent, string filename, string dsname, IDatasetElement element)
            : base(parent, typeof(FeatureClass))
        {
            if (element == null)
            {
                return;
            }

            _parent   = parent;
            _filename = filename;
            _dsname   = dsname;
            _fcname   = element.Title;

            string typePrefix = String.Empty;
            bool   isLinked   = false;

            if (element.Class is LinkedFeatureClass)
            {
                typePrefix = "Linked ";
                isLinked   = true;
            }

            if (element.Class is IRasterCatalogClass)
            {
                _icon = new AccessFDBRasterIcon();
                _type = typePrefix + "Raster Catalog Layer";
                _rc   = (IRasterClass)element.Class;
            }
            else if (element.Class is IRasterClass)
            {
                _icon = new AccessFDBRasterIcon();
                _type = typePrefix + "Raster Layer";
                _rc   = (IRasterClass)element.Class;
            }
            else if (element.Class is IFeatureClass)
            {
                _fc = (IFeatureClass)element.Class;
                switch (_fc.GeometryType)
                {
                case geometryType.Envelope:
                case geometryType.Polygon:
                    if (isLinked)
                    {
                        _icon = new AccessFDBLinkedPolygonIcon();
                    }
                    else
                    {
                        _icon = new AccessFDBPolygonIcon();
                    }
                    _type = typePrefix + "Polygon Featureclass";
                    break;

                case geometryType.Multipoint:
                case geometryType.Point:
                    if (isLinked)
                    {
                        _icon = new AccessFDBLinkedPointIcon();
                    }
                    else
                    {
                        _icon = new AccessFDBPointIcon();
                    }
                    _type = typePrefix + "Point Featureclass";
                    break;

                case geometryType.Polyline:
                    if (isLinked)
                    {
                        _icon = new AccessFDBLinkedLineIcon();
                    }
                    else
                    {
                        _icon = new AccessFDBLineIcon();
                    }
                    _type = typePrefix + "Polyline Featureclass";
                    break;
                }
            }

            _contextItems    = new ToolStripItem[1];
            _contextItems[0] = new ToolStripMenuItem("Tasks");

            //_contextItems = new ToolStripItem[1];
            //_contextItems[0] = new ToolStripMenuItem("Rebuild Spatial Index...");
            //_contextItems[0].Click += new EventHandler(RebuildSpatialIndex_Click);
            ToolStripMenuItem item = new ToolStripMenuItem("Shrink Spatial Index...");

            item.Click += new EventHandler(ShrinkSpatialIndex_Click);
            ((ToolStripMenuItem)_contextItems[0]).DropDownItems.Add(item);
            item        = new ToolStripMenuItem("Spatial Index Definition...");
            item.Click += new EventHandler(SpatialIndexDef_Click);
            ((ToolStripMenuItem)_contextItems[0]).DropDownItems.Add(item);
            item        = new ToolStripMenuItem("Repair Spatial Index...");
            item.Click += new EventHandler(RepairSpatialIndex_Click);
            ((ToolStripMenuItem)_contextItems[0]).DropDownItems.Add(item);
            ((ToolStripMenuItem)_contextItems[0]).DropDownItems.Add(new ToolStripSeparator());
            item        = new ToolStripMenuItem("Truncate");
            item.Click += new EventHandler(Truncate_Click);
            ((ToolStripMenuItem)_contextItems[0]).DropDownItems.Add(item);
        }