Exemplo n.º 1
0
        //------------------------------------------------------------------------------------------------------------------------
        private static IList <SimpleMenuItem> DescribeFilesAssociatedWithDeclaredElement(Lifetime lifetime, DocumentManager documentManager, IClrDeclaredElement declaredElement, Func <IProjectFile, Action> clickAction)
        {
            IList <SimpleMenuItem> menuItems = new List <SimpleMenuItem>();

            var projectFiles = GetProjectFiles(documentManager, declaredElement);

            foreach (var projectFile in projectFiles)
            {
                IProjectFile currentProjectFile = projectFile;
                var          np = new ProjectFileNavigationPoint(currentProjectFile);

                var result = new SimpleMenuItemForProjectItem(np.GetPresentationText()
                                                              , np.GetPresentationImage()
                                                              , ResharperHelper.ProtectActionFromReEntry(lifetime, "TestingMenuNavigation", clickAction.Invoke(projectFile))
                                                              , projectFile, declaredElement
                                                              );

                result.ShortcutText = np.GetSecondaryPresentationText();
                result.Style        = MenuItemStyle.Enabled;
                result.Tag          = projectFile.Location.FullPath;

                menuItems.Add(result);
            }
            return(menuItems);
        }
        private static void NavigateToFiles(
            ISolution solution,
            List <FileGeneratorOutput> fileGeneratorOutputs,
            List <InPlaceGeneratorOutput> inPlaceGeneratorOutputs)
        {
            NavigationManager navigationManager = NavigationManager.GetInstance(solution);

            var navigationOptions = NavigationOptions.FromWindowContext(
                Shell.Instance.GetComponent <IMainWindowPopupWindowContext>().Source,
                "",
                false /* activate */
                );

            foreach (FileGeneratorOutput output in fileGeneratorOutputs)
            {
                var navigationPoint = new ProjectFileNavigationPoint(output.GeneratedProjectFile);
                navigationManager.Navigate(navigationPoint, navigationOptions);
            }

            foreach (InPlaceGeneratorOutput output in inPlaceGeneratorOutputs)
            {
                var navigationPoint = new ProjectFileNavigationPoint(output.ProjectFile);
                navigationManager.Navigate(navigationPoint, navigationOptions);
            }
        }
Exemplo n.º 3
0
        public override void SuccessfulFinish(IProgressIndicator pi)
        {
            if (DataModel.FilesToConvert.Length == 1)
            {
                var target = new ProjectFileNavigationPoint(DataModel.FilesToConvert[0].ConvertedFile);
                NavigationManager
                .GetInstance(Solution)
                .Navigate(target, NavigationOptions.FromWindowContext(mainWindowPopupWindowContext.Source, ""));
            }

            base.SuccessfulFinish(pi);
        }
        private static void NavigateToFile(ISolution solution, IProjectFile generatedFile)
        {
            var navigationManager = NavigationManager.GetInstance(solution);
            var navigationPoint   = new ProjectFileNavigationPoint(generatedFile);
            var navigationOptions = NavigationOptions.FromWindowContext(
                Shell.Instance.GetComponent <IMainWindowPopupWindowContext>().Source,
                "",
                false /* activate */
                );

            navigationManager.Navigate(navigationPoint, navigationOptions);
        }