/// <summary>
        /// Default constructor
        /// </summary>
        public DirectoryStructureViewModel()
        {
            //  Get the logical drives
            var children = DirectoryStructure.GetLogicalDrives();

            // Create the view model from the data
            this.Items = new ObservableCollection <DirectoryItemViewModel>(
                children.Select(drive => new DirectoryItemViewModel(drive.FullPath, DirectoryItemType.Drive)));
        }
Esempio n. 2
0
        /// <summary>
        /// Expands this directory and find all children
        /// </summary>
        private void Expand()
        {
            // We can't expand a file
            if (this.Type == DirectoryItemType.File)
            {
                return;
            }

            // Find all children
            this.Children = new ObservableCollection <DirectoryItemViewModel>
                                (DirectoryStructure.GetDirectoryContents(this.FullPath).Select(content =>
                                                                                               new DirectoryItemViewModel(content.FullPath, content.Type)));
        }