Ejemplo n.º 1
0
        public void FollowReference(object @ref, bool newTab, bool setFocus, Action <ShowTabContentEventArgs> onShown)
        {
            if (@ref == null)
            {
                return;
            }

            IFileTab tab       = ActiveTabContentImpl;
            var      sourceTab = tab;

            if (tab == null)
            {
                tab = SafeActiveTabContentImpl;
            }
            else if (newTab)
            {
                var g = TabGroupManager.ActiveTabGroup;
                Debug.Assert(g != null);
                if (g == null)
                {
                    return;
                }
                tab = OpenEmptyTab(g);
            }
            tab.FollowReference(@ref, sourceTab == null ? null : sourceTab.Content, onShown);
            if (setFocus)
            {
                SetFocus(tab);
            }
        }
Ejemplo n.º 2
0
		void JumpToCurrentStatement(IFileTab tab, bool canRefreshMethods) {
			if (tab == null)
				return;
			if (currentMethod == null)
				return;

			// The file could've been added lazily to the list so add a short delay before we select it
			Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => {
				tab.FollowReference(currentMethod, false, e => {
					Debug.Assert(e.Tab == tab);
					Debug.Assert(e.Tab.UIContext is ITextEditorUIContext);
					if (e.Success && !e.HasMovedCaret) {
						MoveCaretToCurrentStatement(e.Tab.UIContext as ITextEditorUIContext, canRefreshMethods);
						e.HasMovedCaret = true;
					}
				});
			}));
		}