/// <summary> /// Open solution, send to ShowMissingComponents, and display general results /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoadSolution_Button_Click(object sender, EventArgs e) { OpenSolution.ShowDialog(); if (OpenSolution.SafeFileName == "OpenSolution") { return; } byte[] SolutionFile = File.ReadAllBytes(OpenSolution.FileName); BackgroundProgressIndicator.RunWorkerAsync(SolutionFile); string Status = ShowMissingComponents(SolutionFile); if (Status == "Succeeded") { output_txt.Text = $@"Found missing dependencies in target enviornment... {Environment.NewLine}{OpenSolution.FileName}. {Environment.NewLine}Output available at: {txt_OutputPath.Text}\dependencies.csv"; } else if (Status == "No Missing Components") { output_txt.Text = $"There were no missing components in {Environment.NewLine + OpenSolution.SafeFileName}"; } else { output_txt.Text = Status; } }
static void ActiveWindowChanged(object sender, EventArgs e) { object activeContent = WorkbenchSingleton.Workbench.ActiveContent; IViewContent viewContent = activeContent as IViewContent; if (viewContent == null && activeContent is ISecondaryViewContent) { // required if one creates a new winforms app and then immediately switches to design mode // without focussing the text editor IWorkbenchWindow window = ((ISecondaryViewContent)activeContent).WorkbenchWindow; if (window == null) // workbench window is being disposed { return; } viewContent = window.ViewContent; } if (OpenSolution == null || viewContent == null) { return; } string fileName = viewContent.FileName; if (fileName == null) { return; } CurrentProject = OpenSolution.FindProjectContainingFile(fileName) ?? CurrentProject; }
static void HandleRemovedSolutionFolder(ISolutionFolder folder) { if (folder is IProject) { OpenSolution.RemoveProjectConfigurations(folder.IdGuid); ParserService.RemoveProjectContentForRemovedProject((IProject)folder); } if (folder is ISolutionFolderContainer) { // recurse into child folders that were also removed ((ISolutionFolderContainer)folder).Folders.ForEach(HandleRemovedSolutionFolder); } }
static void ActiveViewContentChanged(object sender, EventArgs e) { IViewContent viewContent = WorkbenchSingleton.Workbench.ActiveViewContent; if (OpenSolution == null || viewContent == null) { return; } string fileName = viewContent.PrimaryFileName; if (fileName == null) { return; } CurrentProject = OpenSolution.FindProjectContainingFile(fileName) ?? CurrentProject; }
static void HandleRemovedSolutionFolder(ISolutionFolder folder) { IProject project = folder as IProject; if (project != null) { OpenSolution.RemoveProjectConfigurations(project.IdGuid); ParserService.RemoveProjectContentForRemovedProject(project); project.Dispose(); } if (folder is ISolutionFolderContainer) { // recurse into child folders that were also removed ((ISolutionFolderContainer)folder).Folders.ForEach(HandleRemovedSolutionFolder); } }
public void Activation() { var shell = IoC.Get <IShell>(); shell.AddDocument(this); shell.SolutionChanged += ShellOnSolutionChanged; //LoadNewsFeed().GetAwaiter().GetResult(); //LoadVideoFeed().GetAwaiter().GetResult(); var solutionExplorer = IoC.Get <ISolutionExplorer>(); NewSolution.Subscribe(_ => { solutionExplorer.NewSolution(); }); OpenSolution.Subscribe(_ => { solutionExplorer.OpenSolution(); }); }
private void LaunchSolution(Solution solution) { OpenSolution?.Invoke(solution); }
protected virtual void OnOpenSolution(Solution solution) { OpenSolution?.Invoke(solution); }