Exemplo n.º 1
0
        /// <summary>
        /// Change directory in current FilesView and adequate field
        /// </summary>
        /// <param name="sender"></param>
        private void ChangeDirectory(object sender)
        {
            if (currFilesView == FilesViewL)
            {
                dirL = new DirectoryItem((sender as DirectoryItem).Path);
            }
            else
            {
                dirR = new DirectoryItem((sender as DirectoryItem).Path);
            }

            GetItems();
            RefreshFilesView();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Copies directories recursively with their files
        /// </summary>
        /// <param name="destDirPath">Destination path</param>
        /// <param name="dir">Currently copied directory</param>
        private void PasteDiscItem(string destDirPath, DirectoryItem dir)
        {
            List <DirectoryItem> dirs  = dir.GetDirectories();
            List <FileItem>      files = dir.GetFiles();

            foreach (FileItem file in files)
            {
                if (!File.Exists(Path.Combine(destDirPath, file.Name)))
                {
                    File.Copy(file.Path, Path.Combine(destDirPath, file.Name));
                }
            }
            foreach (DirectoryItem directory in dirs)
            {
                if (!Directory.Exists(Path.Combine(destDirPath, directory.Name)))
                {
                    Directory.CreateDirectory(Path.Combine(destDirPath, directory.Name));
                }
                PasteDiscItem(Path.Combine(destDirPath, directory.Name), directory as DirectoryItem);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Change drive in adequate FilesView
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DrivesComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //change current files view
            if ((sender as ComboBox).Name == "drivesComboBoxL")
            {
                currFilesView          = FilesViewL;
                CopyL_Button.IsEnabled = true;
            }
            else
            {
                currFilesView          = FilesViewR;
                CopyR_Button.IsEnabled = true;
            }

            CreateDirectoryButton.IsEnabled  = true;
            DeleteDirectory_Button.IsEnabled = true;
            currFilesView.IsEnabled          = true;
            string        path = (sender as ComboBox).SelectedItem.ToString();
            DirectoryItem dir  = new DirectoryItem(path);

            ChangeDirectory(dir);
        }