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


C# BuildTarget.setName方法代码示例

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


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

示例1: decodeProject

        static Project decodeProject(XmlElement e, string source_uri)
        {
            if (e == null || !e.Name.Equals("project"))
                throw new ApplicationException("First XML element must be <project/> tag");

            Project project = null;
            if (e != null)
            {
                project = new Project();
                project.setSourceURI(source_uri);
                project.setName(e.GetAttribute("name"));
                project.setWorkingDirectory(e.GetAttribute("workdir"));

            #if TODO_DANI //includes
                // includes
                XmlNodeList includes = e.GetElementsByTagName("include");
                foreach (XmlNode j in includes)
                {
                    decodeInclude((XmlElement)j, project);
                }
            #endif
                // scripts
                XmlNodeList scripts = e.GetElementsByTagName("script");
                foreach (XmlNode j in scripts)
                {
                    Script script = decodeScript((XmlElement)j, project);
                    if (script != null)
                        project.getScripts().Add(script);
                }

                //some project variables.
                XmlNodeList engines = e.GetElementsByTagName("scriptEngine");
                foreach (XmlElement engine in engines)
                {
                    Registry.instance().LoadAndRegistryEngine(engine.GetAttribute("Class"), engine.GetAttribute("Assembly"));
                }

                XmlNodeList nl = e.GetElementsByTagName("mogreRender");
                foreach (XmlElement n in nl)
                {
                    decodeMogreRender(n, project);
                }

            #if !TODO_DANI //resources

                // resources
                XmlNodeList resources = e.GetElementsByTagName("resource");
                foreach (XmlNode j in resources)
                {
                    Resource resource = decodeResource((XmlElement)j, project);
                    if (resource != null)
                        project.getResources().Add(resource);
                }

            #endif

                // graphs
                XmlNodeList graphs = e.GetElementsByTagName("graph");
                foreach (XmlNode j in graphs)
                {
                    FilterGraph graph = decodeFilterGraph((XmlElement)j, project);
                    if (graph != null)
                        project.getFilterGraphs().Add(graph);
                }

            #if TODO_DANI //terrains

                // terrains (depends on resources)
                XmlNodeList terrains = e.GetElementsByTagName("terrain");
                foreach (XmlNode j in terrains)
                {
                    Terrain terrain = decodeTerrain((XmlElement)j, project);
                    if (terrain != null)
                        project.getTerrains().Add(terrain);
                }

            #endif

                // sources - 2 passes, since a source can reference another source
                XmlNodeList sources = e.GetElementsByTagName("source");
                foreach (XmlNode j in sources)
                {

                    // TODO Dani, meter esto en un try catch

                    Source source = decodeSource((XmlElement)j, project, 0);
                    if (source != null)
                    {
                        project.getSources().Add(source);

            #if TODO_DANI
                        // also add each source as a feature layer resource
                        Resource resource = MogreGis.Registry.instance().createResourceByType("FeatureLayerResource");
                        resource.setBaseURI(project.getBaseURI());
                        resource.setURI(source.getURI());
                        resource.setName(source.getName());
                        project.getResources().Add(resource);
            #endif
                    }
                }
//.........这里部分代码省略.........
开发者ID:agustinsantos,项目名称:mogregis3d,代码行数:101,代码来源:XmlSerializer.cs

示例2: decodeTarget

        static BuildTarget decodeTarget(XmlElement e, Project proj)
        {
            BuildTarget target = null;
            if (e != null)
            {
                target = new BuildTarget();
                target.setName(e.GetAttribute("name"));

                Terrain terrain = proj.getTerrain(e.GetAttribute("terrain"));
                target.setTerrain(terrain);

                XmlNodeList layers = e.GetElementsByTagName("layer");
                foreach (XmlNode i in layers)
                {
                    XmlElement elem = (XmlElement)i;
                    string layer_name = elem.InnerText;
                    if (!string.IsNullOrEmpty(layer_name))
                    {
                        BuildLayer layer = proj.getLayer(layer_name);
                        if (layer != null)
                            target.addLayer(layer);
                    }
                }
            }
            return target;
        }
开发者ID:agustinsantos,项目名称:mogregis3d,代码行数:26,代码来源:XmlSerializer.cs

示例3: decodeProject

        static Project decodeProject(XmlElement e, string source_uri)
        {
            if (e == null || !e.Name.Equals("project"))
                throw new ApplicationException("First XML element must be <project/> tag");

            Project project = null;
            if (e != null)
            {
                project = new Project();
                project.setSourceURI(source_uri);
                project.setName(e.GetAttribute("name"));
                project.setWorkingDirectory(e.GetAttribute("workdir"));

                // resources
                XmlNodeList resources = e.GetElementsByTagName("resource");
                foreach (XmlNode j in resources)
                {
                    MogreGis.Resource resource = decodeResource((XmlElement)j, project);
                    if (resource != null)
                        project.getResources().Add(resource);
                }

                #region TODO_PH_FILTERGRAPHS
            #if TODO_PH
                // graphs
                XmlNodeList graphs = e.GetElementsByTagName("graph");
                foreach (XmlNode j in graphs)
                {
                    FilterGraph graph = decodeFilterGraph((XmlElement)j, project);
                    if (graph != null)
                        project.getFilterGraphs().Add(graph);
                }
            #endif
                #endregion

                // sources - 2 passes, since a source can reference another source
                XmlNodeList sources = e.GetElementsByTagName("source");
                foreach (XmlNode j in sources)
                {

                    // TODO Dani, meter esto en un try catch

                    ShapeFile shapeFile = decodeShapeFile((XmlElement)j, project, 0);
                    if (shapeFile != null)
                    {
                        project.getShapeFiles().Add(shapeFile);
                    }
                }
                foreach (XmlNode j in sources)
                {
                    decodeShapeFile((XmlElement)j, project, 1);
                }

                #region TODO_PH_LAYERS
            #if TODO_PH_LAYERS
                XmlNodeList layers = e.GetElementsByTagName("layer");
                foreach (XmlNode j in layers)
                {
                    SharpMap.Layers.VectorLayer l = new SharpMap.Layers.VectorLayer(
                    BuildLayer layer = decodeLayer((XmlElement)j, project);
                    if (layer != null)
                    {
                        project.getLayers().Add(layer);

                        // automatically add a target for this layer alone:
                        BuildTarget layer_target = new BuildTarget();
                        layer_target.setName(layer.getName());
                        layer_target.addLayer(layer);
                        project.getTargets().Add(layer_target);
                    }
                }
            #endif
                #endregion

            }
            return project;
        }
开发者ID:agustinsantos,项目名称:mogregis3d,代码行数:77,代码来源:XMLSerializer.cs


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