예제 #1
0
        private void SetRenderers(XmlNode layerNode, IFeatureLayer fLayer)
        {
            fLayer.FeatureRenderer = null;
            fLayer.LabelRenderer   = null;
            foreach (XmlNode child in layerNode.ChildNodes)
            {
                if (child.Name == "SIMPLERENDERER")
                {
                    fLayer.FeatureRenderer = ObjectFromAXLFactory.SimpleRenderer(child);
                }
                else if (child.Name == "VALUEMAPRENDERER")
                {
                    fLayer.FeatureRenderer = ObjectFromAXLFactory.ValueMapRenderer(child);
                }
                else if (child.Name == "SIMPLELABELRENDERER")
                {
                    fLayer.LabelRenderer = ObjectFromAXLFactory.SimpleLabelRenderer(child, fLayer.FeatureClass);
                }
                else if (child.Name == "SCALEDEPENDENTRENDERER")
                {
                    if (child.SelectSingleNode("SIMPLELABELRENDERER") != null)
                    {
                        fLayer.LabelRenderer = ObjectFromAXLFactory.ScaleDependentLabelRenderer(child, fLayer.FeatureClass);
                    }
                    if (child.SelectSingleNode("SIMPLERENDERER") != null ||
                        child.SelectSingleNode("VALUEMAPRENDERER") != null)
                    {
                        fLayer.FeatureRenderer = ObjectFromAXLFactory.ScaleDependentRenderer(child);
                    }
                }
                else if (child.Name == "GROUPRENDERER")
                {
                    fLayer.FeatureRenderer = ObjectFromAXLFactory.GroupRenderer(child);

                    foreach (XmlNode child2 in child.ChildNodes)
                    {
                        if (child2.Name == "SIMPLELABELRENDERER")
                        {
                            fLayer.LabelRenderer = ObjectFromAXLFactory.SimpleLabelRenderer(child2, fLayer.FeatureClass);
                        }
                        else if (child2.Name == "SCALEDEPENDENTRENDERER")
                        {
                            if (child2.SelectSingleNode("SIMPLELABELRENDERER") != null)
                            {
                                fLayer.LabelRenderer = ObjectFromAXLFactory.ScaleDependentLabelRenderer(child2, fLayer.FeatureClass);
                            }
                            //if (child2.SelectSingleNode("SIMPLERENDERER") != null ||
                            //    child2.SelectSingleNode("VALUEMAPRENDERER") != null)
                            //{
                            //    fLayer.FeatureRenderer = ObjectFromAXLFactory.ScaleDependentRenderer(child2);
                            //}
                        }
                    }
                }
            }

            #region Renderer vereinfachen
            fLayer.FeatureRenderer = SimplifyRenderer(fLayer.FeatureRenderer) as IFeatureRenderer;
            #endregion
        }
예제 #2
0
        private void SetRenderers(XmlNode layerNode, IFeatureLayer fLayer)
        {
            fLayer.FeatureRenderer = null;
            fLayer.LabelRenderer   = null;
            foreach (XmlNode child in layerNode.ChildNodes)
            {
                if (child.Name == "SIMPLERENDERER")
                {
                    fLayer.FeatureRenderer = ObjectFromAXLFactory.SimpleRenderer(child);
                }
                else if (child.Name == "VALUEMAPRENDERER")
                {
                    fLayer.FeatureRenderer = ObjectFromAXLFactory.ValueMapRenderer(child);
                }
                else if (child.Name == "SIMPLELABELRENDERER")
                {
                    fLayer.LabelRenderer = ObjectFromAXLFactory.SimpleLabelRenderer(child, fLayer.FeatureClass);
                }
                else if (child.Name == "GROUPRENDERER")
                {
                    fLayer.FeatureRenderer = ObjectFromAXLFactory.GroupRenderer(child);

                    foreach (XmlNode child2 in child.ChildNodes)
                    {
                        //if (child2.Name == "SIMPLERENDERER")
                        //{
                        //    fLayer.FeatureRenderer = ObjectFromAXLFactory.SimpleRenderer(child2);
                        //}
                        //else if (child2.Name == "VALUEMAPRENDERER")
                        //{
                        //    fLayer.FeatureRenderer = ObjectFromAXLFactory.ValueMapRenderer(child2);
                        //}
                        if (child2.Name == "SIMPLELABELRENDERER")
                        {
                            fLayer.LabelRenderer = ObjectFromAXLFactory.SimpleLabelRenderer(child2, fLayer.FeatureClass);
                        }
                    }
                }
            }
        }