Пример #1
0
        static public gView.Framework.Symbology.ILegendGroup LegendGroup(LayerItem layerItem)
        {
            if (layerItem == null)
            {
                return(null);
            }

            List <ILayer> layers = layerItem.TOCElement.Layers;

            if (layers.Count == 0)
            {
                return(null);
            }

            ILayer elem = layers[0];

            if (!(elem is IFeatureLayer))
            {
                return(null);
            }

            LegendGroupGroup legendGroup   = new LegendGroupGroup();
            ILabelRenderer   labelRenderer = ((IFeatureLayer)elem).LabelRenderer;

            if (labelRenderer is ILegendGroup)
            {
                legendGroup.Add((ILegendGroup)labelRenderer);
            }

            IFeatureRenderer renderer = ((IFeatureLayer)elem).FeatureRenderer;

            if (renderer is ILegendGroup)
            {
                legendGroup.Add((ILegendGroup)renderer);
            }

            return(legendGroup.Count > 0 ? legendGroup : null);
        }
Пример #2
0
 public LegendItem(ILegendItem legendItem, LayerItem layerItem)
 {
     _legendItem = legendItem;
     _layerItem  = layerItem;
 }