public bool CanRender(gView.Framework.Data.IFeatureLayer layer, IMap map) { if (_renderer == null) { return(false); } return(_renderer.CanRender(layer, map)); }
private void MakeTree() { PlugInManager compManager = new PlugInManager(); if (_type == RendererType.featureRenderer) { foreach (XmlNode xmlnode in compManager.GetPluginNodes(Plugins.Type.IFeatureRenderer)) { IFeatureRenderer renderer = (IFeatureRenderer)compManager.CreateInstance(xmlnode); if (renderer == null || !renderer.CanRender(_layer, null)) { continue; } TreeNode parent = null; foreach (TreeNode cat in tvRenderer.Nodes) { if (cat.Text == renderer.Category) { parent = cat; break; } } if (parent == null) { parent = new TreeNode(renderer.Category); tvRenderer.Nodes.Add(parent); } TreeNode rNode = new RendererNode(renderer); parent.Nodes.Add(rNode); } } else if (_type == RendererType.labelRenderer) { TreeNode parent = new TreeNode("Label Renderers"); foreach (XmlNode xmlnode in compManager.GetPluginNodes(Plugins.Type.ILabelRenderer)) { ILabelRenderer renderer = (ILabelRenderer)compManager.CreateInstance(xmlnode); if (renderer == null || !renderer.CanRender(_layer, null)) { continue; } parent.Nodes.Add(new LabelRendererNode(renderer)); } tvRenderer.Nodes.Add(parent); } foreach (TreeNode parent in tvRenderer.Nodes) { parent.Expand(); } }