Exemplo n.º 1
0
        internal override void Load()
        {
            ExpandedPropertyGroups.AddRange(FolderEntity.ExpandedPropertyGroups);

            // Load child folders
            foreach (FolderEntity childFolder in Profile.ProfileEntity.Folders.Where(f => f.ParentId == EntityId))
            {
                ChildrenList.Add(new Folder(Profile, this, childFolder));
            }
            // Load child layers
            foreach (LayerEntity childLayer in Profile.ProfileEntity.Layers.Where(f => f.ParentId == EntityId))
            {
                ChildrenList.Add(new Layer(Profile, this, childLayer));
            }

            // Ensure order integrity, should be unnecessary but no one is perfect specially me
            ChildrenList = ChildrenList.OrderBy(c => c.Order).ToList();
            for (int index = 0; index < ChildrenList.Count; index++)
            {
                ChildrenList[index].Order = index + 1;
            }

            LoadRenderElement();
        }