private IList <string> ParseLocalizationKeys() { List <string> keys = new List <string>(); FileInfo[] xamlFiles = SolutionDirectory.GetFiles("*.xaml", SearchOption.AllDirectories); foreach (FileInfo xamlFile in xamlFiles) { MatchCollection matches = null; using (StreamReader sr = xamlFile.OpenText()) matches = xamlRegex.Matches(sr.ReadToEnd()); foreach (Match match in matches) { if (!match.Success) { continue; } keys.Add(match.Groups["key"].Value); } } return(keys); }
/// <summary> /// Called, when the solution directory changes /// </summary> private void SolutionDirectoryChangedCallback() { AppRegistry.SetValue(RegistryKeys.SolutionPath, SolutionPath); ProjectDirectories = new ObservableCollection <DirectoryInfo>( SolutionDirectory.GetFiles("*.csproj", SearchOption.AllDirectories) .Select(f => f.Directory) .ToList() ); string lastProjectUsed = AppRegistry.GetValue(RegistryKeys.SelectedProject); if (String.IsNullOrEmpty(lastProjectUsed)) { return; } SelectedProjectDirectory = ProjectDirectories.FirstOrDefault(dir => dir.FullName == lastProjectUsed); }