Ejemplo n.º 1
0
 public NavigationInfo(string name, NavigationKind kind, SnapshotSpan span, NavigationInfo[] children) {
     Name = name;
     Kind = kind;
     Span = span;
     Children = children;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Wired to parser event for when the parser has completed parsing a new tree and we need
        /// to update the navigation bar with the new data.
        /// </summary>
        private async void ParserOnNewParseTree(AnalysisEntry entry) {
            var dropDownBar = _dropDownBar;
            if (dropDownBar == null) {
                return;
            }

            var navigations = await _uiThread.InvokeTask(() => _analysisEntry.Analyzer.GetNavigationsAsync(_textView));
            lock (_navigationsLock) {
                _navigations = navigations;
                for (int i = 0; i < _curSelection.Length; i++) {
                    _curSelection[i] = -1;
                }
            }

            Action callback = () => CaretPositionChanged(
                this,
                new CaretPositionChangedEventArgs(
                    _textView,
                    _textView.Caret.Position,
                    _textView.Caret.Position
                )
            );

            try {
                await _dispatcher.BeginInvoke(callback, DispatcherPriority.Background);
            } catch (TaskCanceledException) {
            }
        }