public void InstallSelected() { var amount = FoundAssemblies.Count(a => a.InstallChecked); foreach (var assembly in FoundAssemblies.ToArray()) { if (assembly.InstallChecked) { if (assembly.Compile()) { if ( Config.Instance.SelectedProfile.InstalledAssemblies.All( a => a.Name != assembly.Name || a.SvnUrl != assembly.SvnUrl)) { Config.Instance.SelectedProfile.InstalledAssemblies.Add(assembly); FoundAssemblies.Remove(assembly); } amount--; } } } FoundAssemblies.Where(a => !string.IsNullOrEmpty(a.SvnUrl)).ToList().ForEach(x => GitUpdater.ClearUnusedRepoFolder(x.PathToProjectFile, Logs.MainLog)); if (amount == 0) { AfterInstallMessage(Utility.GetMultiLanguageText("SuccessfullyInstalled"), true); } else { AfterInstallMessage(Utility.GetMultiLanguageText("ErrorInstalling")); } }
public void InstallSelected() { var amount = FoundAssemblies.Count(a => a.InstallChecked); foreach (var assembly in FoundAssemblies) { if (assembly.InstallChecked) { if (assembly.Compile()) { if ( Config.Instance.SelectedProfile.InstalledAssemblies.All( a => a.Name != assembly.Name || a.SvnUrl != assembly.SvnUrl)) { Config.Instance.SelectedProfile.InstalledAssemblies.Add(assembly); } amount--; } } } if (amount == 0) { AfterInstallMessage(Utility.GetMultiLanguageText("SuccessfullyInstalled"), true); } else { AfterInstallMessage(Utility.GetMultiLanguageText("ErrorInstalling")); } }
public void InstallSelected() { var amount = FoundAssemblies.Count(a => a.InstallChecked); foreach (var assembly in FoundAssemblies) { if (assembly.InstallChecked) { if (assembly.Compile()) { if ( ((MainWindow)Owner).Config.SelectedProfile.InstalledAssemblies.All( a => a.Name != assembly.Name || a.SvnUrl != assembly.SvnUrl)) { ((MainWindow)Owner).Config.SelectedProfile.InstalledAssemblies.Add(assembly); } amount--; } } } if (amount == 0) { AfterInstallMessage("Selected assemblies succesfully installed.", true); } else { AfterInstallMessage( "There was an error while trying to install some of the assemblies, check the log for more details."); } }
public void ListAssemblies(string location, bool isSvn, string autoInstallName = null) { AbleToList = false; var bgWorker = new BackgroundWorker(); if (!isSvn) { bgWorker.DoWork += delegate { FoundAssemblies = LeagueSharpAssemblies.GetAssemblies(location); }; } else { bgWorker.DoWork += delegate { var updatedDir = GitUpdater.Update(location, Logs.MainLog, Directories.RepositoryDir); FoundAssemblies = LeagueSharpAssemblies.GetAssemblies(updatedDir, location); foreach (var assembly in FoundAssemblies.ToArray()) { List <LeagueSharpAssembly> assemblies = Config.Instance.SelectedProfile.InstalledAssemblies.Where( y => y.Name == assembly.Name && y.SvnUrl == assembly.SvnUrl).ToList(); assemblies.ForEach(a => FoundAssemblies.Remove(a)); } foreach (var assembly in FoundAssemblies) { if (autoInstallName != null && assembly.Name.ToLower() == autoInstallName.ToLower()) { assembly.InstallChecked = true; } } }; } bgWorker.RunWorkerCompleted += delegate { if (controller != null) { controller.CloseAsync(); controller = null; } AbleToList = true; Application.Current.Dispatcher.Invoke(() => installTabControl.SelectedIndex++); if (autoInstallName != null) { InstallSelected(); } }; bgWorker.RunWorkerAsync(); }
private void Step1_Click(object sender, RoutedEventArgs e) { if (InstalledRadioButton.IsChecked == true) { FoundAssemblies.Clear(); foreach (var profile in ((MainWindow)Owner).Config.Profiles) { FoundAssemblies.AddRange(profile.InstalledAssemblies); } installTabControl.SelectedIndex++; } else { ShowProgress( (SvnRadioButton.IsChecked == true) ? SvnComboBox.Text : PathTextBox.Text, (SvnRadioButton.IsChecked == true)); } }
private void Step1_Click(object sender, RoutedEventArgs e) { if (InstalledRadioButton.IsChecked == true) { FoundAssemblies.Clear(); foreach (var profile in Config.Instance.Profiles) { foreach (var assembly in profile.InstalledAssemblies) { FoundAssemblies.Add(assembly.Copy()); } } FoundAssemblies = FoundAssemblies.Distinct().ToList(); installTabControl.SelectedIndex++; } else { ShowProgress( (SvnRadioButton.IsChecked == true) ? SvnComboBox.Text : PathTextBox.Text, (SvnRadioButton.IsChecked == true)); } }
private void FoundItem(object sender, NuGenFoundItemEventArgs eventArgs) { if (sender != QuickFinder) { eventArgs.Cancel = true; } else { ListViewGroup assemblyGroup = (FoundAssemblies.ContainsKey(eventArgs.Assembly) ? FoundAssemblies[eventArgs.Assembly] : null); if (assemblyGroup == null) { assemblyGroup = new ListViewGroup(eventArgs.Assembly.Name); foundItemsList.Groups.Add(assemblyGroup); FoundAssemblies[eventArgs.Assembly] = assemblyGroup; } ListViewItem foundItem = new ListViewItem(new string[] { eventArgs.FoundTokenObject.Name, Convert.ToString(eventArgs.FoundTokenObject.ItemType) }); foundItem.Group = assemblyGroup; foundItem.ToolTipText = eventArgs.FoundTokenObject.Name; foundItem.Tag = eventArgs.FoundTokenObject; foundItemsList.Items.Add(foundItem); } }