예제 #1
0
        /// <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;
            }
        }
예제 #2
0
        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;
        }
예제 #3
0
 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);
     }
 }
예제 #4
0
        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;
        }
예제 #5
0
        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);
            }
        }
예제 #6
0
        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();
            });
        }
예제 #7
0
 private void LaunchSolution(Solution solution)
 {
     OpenSolution?.Invoke(solution);
 }
예제 #8
0
 protected virtual void OnOpenSolution(Solution solution)
 {
     OpenSolution?.Invoke(solution);
 }