Esempio n. 1
0
        private void RefreshLayersTree()
        {
            IAddressNode currentNode = _editAddressBar.CurrentNode;

            IAddressNode[]         layers = new IAddressNode[_layers.Count];
            VisibleLayerRadioGroup visibleLayerRadioGroup = new VisibleLayerRadioGroup();

            for (int layerIndex = 0; layerIndex < layers.Length; layerIndex++)
            {
                IRoomEditorFilter layer    = _layers[layerIndex];
                List <string>     names    = layer.GetItemsNames();
                IAddressNode[]    children = new IAddressNode[names.Count];
                for (int index = 0; index < names.Count; index++)
                {
                    string name = names[index];
                    children[index] = new RoomEditNode(GetLayerItemUniqueID(layer, name), name, new IAddressNode[0], true, false)
                    {
                    };
                }
                RoomEditNode node = new RoomEditNode(layer.DisplayName, children, layer.VisibleByDefault);
                node.Layer = layer;
                if (layer is BaseAreasEditorFilter)
                {
                    node.VisibleGroup = visibleLayerRadioGroup;
                }
                foreach (IAddressNode child in children)
                {
                    child.Parent = node;
                }
                layers[layerIndex] = node;
            }
            _layersRoot = new RoomEditNode("Room", layers, true);
            foreach (IAddressNode layer in layers)
            {
                layer.Parent = _layersRoot;
            }
            _editAddressBar.InitializeRoot(_layersRoot);

            SelectOldNode(currentNode);
        }