Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
            public ServiceableDatasetItem(MapServerConnectionExplorerObject exObject, IServiceableDataset sds)
            {
                _exObject = exObject;
                _sds      = sds;

                if (sds == null)
                {
                    return;
                }
                base.Text   = sds.Name;
                base.Click += new EventHandler(ServiceableDatasetItem_Click);
            }
Exemplo n.º 3
0
        async public Task <IExplorerObject> CreateInstanceByFullName(string FullName, ISerializableExplorerObjectCache cache)
        {
            if (cache.Contains(FullName))
            {
                return(cache[FullName]);
            }

            FullName = FullName.Replace("/", @"\");
            int lastIndex = FullName.LastIndexOf(@"\");

            if (lastIndex == -1)
            {
                return(null);
            }

            string cnName = FullName.Substring(0, lastIndex);
            string svName = FullName.Substring(lastIndex + 1, FullName.Length - lastIndex - 1);

            MapServerConnectionExplorerObject pObj = new MapServerConnectionExplorerObject(null);

            pObj = pObj.CreateInstanceByFullName(cnName) as MapServerConnectionExplorerObject;

            var childObject = await pObj.ChildObjects();

            if (pObj == null || childObject == null)
            {
                return(null);
            }

            foreach (IExplorerObject exObject in childObject)
            {
                if (exObject.Name == svName)
                {
                    cache.Append(exObject);
                    return(exObject);
                }
            }
            return(null);
        }