private void SearchForLocalizableAssemblies() { List <LocalizableAssembly> localizableAssemblies = new List <LocalizableAssembly>(); using (var appDomain = new LocalizationAppDomain(__PathToBinaries)) { foreach (var fullFilePath in Directory.EnumerateFiles(__PathToBinaries, "*.exe")) { CheckAndAddAssembly( localizableAssemblies, System.IO.Path.GetFileName(fullFilePath), __PathToBinaries, appDomain); } foreach (var fullFilePath in Directory.EnumerateFiles(__PathToBinaries, "*.dll")) { CheckAndAddAssembly( localizableAssemblies, System.IO.Path.GetFileName(fullFilePath), __PathToBinaries, appDomain); } } SetDefaultCulture(); __AvailableAssemblies.Clear(); if (localizableAssemblies.Count > 0) { DefaultCulture = localizableAssemblies[0].DefaultCulture; } foreach (var assembly in localizableAssemblies) { if (assembly.DefaultCulture == DefaultCulture) { var selectedAssembly = new AvailableAssemblyForTranslation(__AvailableAssemblies, assembly); selectedAssembly.IsSelected = true; __AvailableAssemblies.Add(selectedAssembly); } } DoPropertyChange("DefaultCulture"); }
public pp_Settings() { InitializeComponent(); DataContext = this; __Assemblies = new AvailableAssembliesCollection(); foreach (var assembly in Document.Assemblies) { var assemblyItem = new AvailableAssemblyForTranslation(__Assemblies, assembly.Assembly); __Assemblies.Add(assemblyItem); } FillAssembliesToRemove(); }