Exemplo n.º 1
0
        private void ChangeOpenedItemsByNewItemType()
        {
            switch (openedFileSystemItem.Type)
            {
            case FileSystemItemType.Directory:
                FileSystemItems.AddRange(openedFileSystemItem.Children);
                break;

            case FileSystemItemType.File:
                openedFileSystemItem.ModifyArea(FileSystemItemAreaType.MaximumArea);

                FileSystemItems.Add(openedFileSystemItem);
                break;
            }
        }
Exemplo n.º 2
0
        public FileSystemItem Create(FileSystemItemType type, string content, FileSystemItem parent, FileSystemItemAreaType areaType)
        {
            var child = new FileSystemItem
            {
                Children        = new List <FileSystemItem>(),
                Content         = content,
                Parent          = parent,
                Type            = type,
                BackgroundColor = colorGetter.GetNextColor()
            };

            child.ModifyArea(areaType);

            return(child);
        }