コード例 #1
0
 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 "";
     }
 }
コード例 #2
0
        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);
                        }
                    }
                }
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
 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;
 }
コード例 #5
0
        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();
                    }
                }
            }
        }
コード例 #6
0
 void ConnectLayerUi(Layer layer)
 {
     LayerUI layerUI = layer.GetPrimaryUI();
     layerUI.SetUICallbacks(this);
 }
コード例 #7
0
        private bool ActivateLayerLocal(Layer layer)
        {
            TreeNode selectNode = FindLayerNode(layerTree.Nodes, layer);
            if (selectNode != null)
            {
                layerTree.SelectedNode = selectNode;
                return true;
            }

            return false;
        }