コード例 #1
0
ファイル: TOCControl_Items.cs プロジェクト: jugstalt/gview5
        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
ファイル: TOCControl_Items.cs プロジェクト: jugstalt/gview5
 public LegendItem(ILegendItem legendItem, LayerItem layerItem)
 {
     _legendItem = legendItem;
     _layerItem  = layerItem;
 }