예제 #1
0
        public static void RemoveFile(FileDTO file)
        {
            files.Remove(file);
            String[] paths = new String[files.Count];
            var      index = 0;

            foreach (FileDTO f in files)
            {
                paths[index] = f.Path;
                index++;
            }
            Registry.SetValue(registryPath, "ProtectedPaths", paths);
        }
예제 #2
0
        private async void RemoveButtonClick(object sender, RoutedEventArgs e)
        {
            FileDTO selectedFile = filesList.SelectedItem as FileDTO;

            if (selectedFile != null)
            {
                ProtectedFiles.RemoveFile(selectedFile);
            }
            else
            {
                await this.ShowMessageAsync("No file was selected", "Please go back and select a file to be removed");
            }
        }
예제 #3
0
        public static void AddFile(String path)
        {
            FileDTO newFile = new FileDTO(Path.GetFileName(path), path);

            if (!files.Contains(newFile))
            {
                files.Add(newFile);
                String[] paths = new String[files.Count];
                var      index = 0;
                foreach (FileDTO file in files)
                {
                    paths[index] = file.Path;
                    index++;
                }

                Registry.SetValue(registryPath, "ProtectedPaths", paths);
            }
        }