Ejemplo n.º 1
0
        protected override async Task UpdateAsync(CommandInfo info, CancellationToken cancelToken)
        {
            var sym = await FindBaseSymbolsHandler.GetSymbolAtCaret(IdeApp.Workbench.ActiveDocument, cancelToken);

            info.Enabled = sym != null;
            info.Bypass  = !info.Enabled;
        }
Ejemplo n.º 2
0
        protected override async void Update(CommandInfo info)
        {
            var sym = await FindBaseSymbolsHandler.GetSymbolAtCaret(IdeApp.Workbench.ActiveDocument);

            info.Enabled = sym != null;
            info.Bypass  = !info.Enabled;
        }
Ejemplo n.º 3
0
        protected override async void Run(object dataItem)
        {
            var sym = await FindBaseSymbolsHandler.GetSymbolAtCaret(IdeApp.Workbench.ActiveDocument);

            if (sym != null)
            {
                FindDerivedSymbols(sym);
            }
        }
Ejemplo n.º 4
0
        protected override async void Run(object dataItem)
        {
            var metadata = Navigation.Counters.CreateNavigateToMetadata("DerivedSymbols");

            using (var timer = Navigation.Counters.NavigateTo.BeginTiming(metadata)) {
                var sym = await FindBaseSymbolsHandler.GetSymbolAtCaret(IdeApp.Workbench.ActiveDocument);

                if (sym == null)
                {
                    metadata.SetUserFault();
                    return;
                }

                using (var source = new CancellationTokenSource()) {
                    try {
                        await FindDerivedSymbols(sym, source);

                        metadata.SetResult(true);
                    } finally {
                        metadata.UpdateUserCancellation(source.Token);
                    }
                }
            }
        }