private static void OnFileRenamed(object sender, RenamedEventArgs e) { string oldProfileName = Path.GetFileNameWithoutExtension(e.FullPath); AvailableProfiles.Remove(oldProfileName); string profileName = Path.GetFileNameWithoutExtension(e.FullPath); if (!AvailableProfiles.ContainsKey(profileName)) { AvailableProfiles[profileName] = new Profile(e.FullPath); } ReloadActiveConfiguration(); }
private static void OnFileCreated(object sender, FileSystemEventArgs e) { string extension = Path.GetExtension(e.FullPath); if (!extension.Equals(Profile.Extension)) { return; } string profileName = Path.GetFileNameWithoutExtension(e.FullPath); if (!AvailableProfiles.ContainsKey(profileName)) { AvailableProfiles[profileName] = new Profile(e.FullPath); } ReloadActiveConfiguration(); }