private void addDirButton_Click(object sender, RoutedEventArgs e) { string dir = NewroseLib.userSelectDirectoryDialog(); Activate(); //brings window to foreground after dialog if (dir != null) { Console.WriteLine("directory added"); directories.Add(dir); } refreshListView(); }
/// <summary> /// Loads in directory information from registry /// </summary> public static void loadDirectoriesFromRegistry() { RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Newrose\Samplify"); if (key != null) { object dirs = NewroseLib.loadObjectFromRegistry(key, "Directories"); directories.AddRange(dirs as string[]); } if (directories.Count == 0) { string dir = NewroseLib.userSelectDirectoryDialog(); if (dir != null) { directories.Add(dir); } } }