示例#1
0
        /// <summary>
        /// Binds file paths data to list boxes
        /// </summary>
        private void bindFilesListBox()
        {
            Files          = IOClass.ReadFilesList(UserFilesFilepath);
            EncryptedFiles = IOClass.ReadFilesList(this.UserEncryptedFilesFilepath);

            if (Files.Count > 0)
            {
                listBoxFiles.ItemsSource = Files;
            }
            else if (EncryptedFiles.Count >= 0)
            {
                listBoxFiles.ItemsSource = EncryptedFiles;
            }
        }
示例#2
0
        /// <summary>
        /// Activates Ffle dialog and saves file paths that will be protected
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addFilesBtn_Click(object sender, RoutedEventArgs e)
        {
            CommonOpenFileDialog fileDialog = new CommonOpenFileDialog
            {
                InitialDirectory = @"C:\",
                Multiselect      = true
            };

            if (fileDialog.ShowDialog() == CommonFileDialogResult.Ok)
            {
                Files = IOClass.ReadFilesList(this.UserFilesFilepath);
                Files.AddRange(fileDialog.FileNames);
                listBoxFiles.ItemsSource = Files;
                IOClass.SaveFilesList(Files, this.UserFilesFilepath);
            }
        }