public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default) {
			if (!IsValid)
				return false;

			FileSystemPath path = _rangeMarker.Document.GetOutsideSolutionPath();
			if (path.IsEmpty)
				return false;

			var navigationInfo = new T4OutsideSolutionNavigationInfo(path, _rangeMarker.Range, transferFocus, tabOptions);
			var navigationOptions = NavigationOptions.FromWindowContext(windowContext, "Navigate to included file", transferFocus, tabOptions);
			var navigationManager = NavigationManager.GetInstance(solution);
			return navigationManager.Navigate<T4OutsideSolutionNavigationProvider, T4OutsideSolutionNavigationInfo>(navigationInfo, navigationOptions);
		}
Esempio n. 2
0
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default)
        {
            if (!IsValid)
            {
                return(false);
            }

            FileSystemPath path = _rangeMarker.Document.GetOutsideSolutionPath();

            if (path.IsEmpty)
            {
                return(false);
            }

            var navigationInfo = new T4OutsideSolutionNavigationInfo(path, _rangeMarker.Range, transferFocus, tabOptions);
            NavigationOptions navigationOptions = NavigationOptions.FromWindowContext(windowContext, "Navigate to included file", transferFocus, tabOptions);

            return(NavigationManager.GetInstance(solution).Navigate(navigationInfo, navigationOptions));
        }
        private IEnumerable <INavigationPoint> CreateNavigationPoints([NotNull] T4OutsideSolutionNavigationInfo target, [NotNull] IEnumerable <INavigationPoint> basePoints)
        {
            ITextControl textControl = _editorManager.OpenFile(target.FileSystemPath, target.Activate, target.TabOptions);

            if (textControl == null)
            {
                return(basePoints);
            }

            // the source file should exist since we just opened it
            IPsiSourceFile sourceFile = textControl.Document.GetPsiSourceFile(_solution);

            if (sourceFile == null)
            {
                return(basePoints);
            }

            return(new INavigationPoint[] {
                new TextNavigationPoint(sourceFile.ToProjectFile(), target.TextRange.StartOffset)
            });
        }
 private static bool NavigateCore([NotNull] NavigationManager manager, [NotNull] T4OutsideSolutionNavigationInfo info, [NotNull] NavigationOptions options)
 {
     return(manager.Navigate <T4OutsideSolutionNavigationProvider, T4OutsideSolutionNavigationInfo>(info, options));
 }