当前位置: 首页>>代码示例>>C#>>正文


C# MgResourceIdentifier.GetName方法代码示例

本文整理汇总了C#中MgResourceIdentifier.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# MgResourceIdentifier.GetName方法的具体用法?C# MgResourceIdentifier.GetName怎么用?C# MgResourceIdentifier.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MgResourceIdentifier的用法示例。


在下文中一共展示了MgResourceIdentifier.GetName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Invoke

 public override void Invoke()
 {
     var provider = this.Viewer.GetProvider();
     var mdfId = new MgResourceIdentifier(this.MapDefinition);
     var map = provider.CreateMap(mdfId, mdfId.GetName());
     provider.LoadMap(map);
 }
开发者ID:kanbang,项目名称:Colt,代码行数:7,代码来源:MgLoadMapComponent.cs

示例2: CloseMarkup

        public void CloseMarkup()
        {
            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);

            MgMap map = new MgMap();
            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));

            // Add the Markup Layer

            MgResourceIdentifier markupLayerResId = new MgResourceIdentifier(GetParameter(this.args, "OPENMARKUP"));
            int index = map.GetLayers().IndexOf("_" + markupLayerResId.GetName());
            map.GetLayers().RemoveAt(index);

            map.Save(resourceService);
        }
开发者ID:ranyaof,项目名称:Meuhedet,代码行数:15,代码来源:MarkupManager.cs

示例3: OpenMarkup

        public void OpenMarkup()
        {
            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);

            MgMap map = new MgMap();
            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));

            // Create the Layer Groups

            MgLayerGroup markupGroup = null;
            MgLayerGroupCollection layerGroups = map.GetLayerGroups();
            if (layerGroups.Contains("_Markup"))
            {
                markupGroup = layerGroups.GetItem("_Markup");
            }
            else
            {
                markupGroup = new MgLayerGroup("_Markup");
                markupGroup.SetVisible(true);
                markupGroup.SetLegendLabel("Markup");
                markupGroup.SetDisplayInLegend(false);
                layerGroups.Add(markupGroup);
            }

            // Add the Markup Layer

            MgResourceIdentifier markupLayerResId = new MgResourceIdentifier(GetParameter(this.args, "MARKUPLAYER"));
            MgLayer markupLayer = new MgLayer(markupLayerResId, resourceService);
            markupLayer.SetName("_" + markupLayerResId.GetName());
            markupLayer.SetLegendLabel(markupLayerResId.GetName());
            markupLayer.SetDisplayInLegend(false);
            markupLayer.SetSelectable(true);
            markupLayer.SetGroup(markupGroup);
            map.GetLayers().Insert(0, markupLayer);

            map.Save(resourceService);
        }
开发者ID:ranyaof,项目名称:Meuhedet,代码行数:37,代码来源:MarkupManager.cs

示例4: GetAvailableMarkup

        public Hashtable GetAvailableMarkup()
        {
            Hashtable markup = new Hashtable();

            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
            MgResourceIdentifier resourceID = new MgResourceIdentifier(libraryPath);

            try
            {
                MgByteReader byteReader = resourceService.EnumerateResources(resourceID, 1, "LayerDefinition");
                String resourceListXML = byteReader.ToString();

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(resourceListXML);
                XmlNodeList nodeList = doc.GetElementsByTagName("ResourceId");

                foreach (XmlElement element in nodeList)
                {
                    MgResourceIdentifier resourceId = new MgResourceIdentifier(element.InnerText);
                    markup[resourceId.ToString()] = resourceId.GetName();
                }
            }
            catch (MgResourceNotFoundException mge)
            {
                // If the Library://Markup folder does not exist, create it.
                resourceService.SetResource(resourceID, null, null);
            }

            return markup;
        }
开发者ID:ranyaof,项目名称:Meuhedet,代码行数:30,代码来源:MarkupManager.cs

示例5: DeleteMarkup

        public bool DeleteMarkup()
        {
            bool result = false;

            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);

            MgResourceIdentifier markupLayerResId = new MgResourceIdentifier(GetParameter(args, "MARKUPLAYER"));
            MgResourceIdentifier markupSdfResId = new MgResourceIdentifier(libraryPath + markupLayerResId.GetName() + ".FeatureSource");

            //Check related entries in maintenance
            MgMap map = new MgMap();
            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));

               /* string path = map.MapDefinition.Path;
            if (path.ToLower().EndsWith("maps")) path = path.Substring(0, path.Length - 4);
            path = Path.Combine(String.Format("Library://{0}", path), "Maintenance/Data/Maintenance.FeatureSource");

            MgResourceIdentifier maintenanceResId = new MgResourceIdentifier(path);

            MgLayer layer = new MgLayer(markupLayerResId, resourceService);
            if (!map.GetLayers().Contains(layer))
            {
                if (resourceService.ResourceExists(maintenanceResId))
                {
                    MgFeatureQueryOptions opt = new MgFeatureQueryOptions();
                    opt.SetFilter(String.Format("FeatureSource='{0}'", markupSdfResId.ToString()));

                    MgFeatureReader reader = featureService.SelectFeatures(maintenanceResId, "Maintenance:Maintenance", opt);
                    if (!reader.ReadNext())
                    {
                        resourceService.DeleteResource(markupLayerResId);
                        resourceService.DeleteResource(markupSdfResId);
                        result = true;
                    }
                }
                else
                {*/
                    resourceService.DeleteResource(markupLayerResId);
                    resourceService.DeleteResource(markupSdfResId);
                    result = true;
            /*    }
            }*/

            //================================================

            return result;
        }
开发者ID:ranyaof,项目名称:Meuhedet,代码行数:48,代码来源:MarkupManager.cs

示例6: GetMarkupName

 public String GetMarkupName()
 {
     MgResourceIdentifier resId = new MgResourceIdentifier(this.GetMarkupLayer());
     return resId.GetName();
 }
开发者ID:ranyaof,项目名称:Meuhedet,代码行数:5,代码来源:MarkupEditor.cs

示例7: CreateMap

            public MgMapBase CreateMap(MgResourceIdentifier resId)
            {
                //The test suite relies on the same map and not a new one
                //re-created on each test of that particular test suite
                if (_map != null)
                    return _map;

                _map = new MgMap();
                _map.Create(_resSvc, resId, resId.GetName());
                return _map;
            }
开发者ID:kanbang,项目名称:Colt,代码行数:11,代码来源:MapGuideTestExecutorCollection.cs


注:本文中的MgResourceIdentifier.GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。