public static string GetLayerPropByID(Guid ID, string propName, out Layer layer) { if (LayerList.ContainsKey(ID)) { layer = LayerList[ID]; return layer.GetProp(propName); } else { layer = null; return ""; } }
public void UpdateNode(Layer layer, LayerUITreeNode node) { if (node == null) { if (layer != null) { TreeNode[] results = layerTree.Nodes.Find(layer.Name, true); foreach(TreeNode child in results) { if (child.Tag == layer) { child.Nodes.Clear(); this.LoadLayerChildren(layer, child); } } } } }
private void LoadLayerChildren(Layer layer, TreeNode node) { LayerUI layerUI = layer.GetPrimaryUI(); layerUI.SetUICallbacks(this); if (layerUI == null || !layerUI.HasTreeViewNodes) { return; } List<LayerUITreeNode> nodes = layerUI.GetTreeNodes(); foreach (LayerUITreeNode layerNode in nodes) { LoadLayerChild(layerNode, node); } node.Expand(); }
private TreeNode FindLayerNode(TreeNodeCollection nodes, Layer layer) { foreach (TreeNode node in nodes) { if (node.Tag == layer) { return node; } TreeNode found = FindLayerNode(node.Nodes, layer); if (found != null) { return found; } } return null; }
public static void Add(Layer layer, bool updateTree) { if (!LayerList.ContainsKey(layer.ID)) { if (AllMaps.ContainsKey(layer.ReferenceFrame)) { LayerList.Add(layer.ID, layer); AllMaps[layer.ReferenceFrame].Layers.Add(layer); version++; if (updateTree) { LoadTree(); } } } }
void ConnectLayerUi(Layer layer) { LayerUI layerUI = layer.GetPrimaryUI(); layerUI.SetUICallbacks(this); }
private bool ActivateLayerLocal(Layer layer) { TreeNode selectNode = FindLayerNode(layerTree.Nodes, layer); if (selectNode != null) { layerTree.SelectedNode = selectNode; return true; } return false; }