Beispiel #1
0
            async Task CreateMenuForTypeSymbolNodeAsync(CancellationToken cancellationToken)
            {
                if (_Menu != null)
                {
                    ((TextBlock)_Menu.Footer).Clear();
                    await RefreshItemsAsync(Node, cancellationToken);

                    return;
                }
                _Menu = new SymbolList(_Bar._SemanticContext)
                {
                    Container     = _Bar._SymbolListContainer,
                    ContainerType = SymbolListType.NodeList
                };
                _Menu.Header = new WrapPanel {
                    Orientation = Orientation.Horizontal,
                    Children    =
                    {
                        new ThemedButton(new ThemedMenuText(Node.GetDeclarationSignature(),  true)
                                         .SetGlyph(ThemeHelper.GetImage(Node.GetImageId())), null,
                                         () => _Bar._SemanticContext.RelocateDeclarationNode(Node).GetLocation().GoToSource())
                        {
                            BorderThickness = WpfHelper.TinyMargin,
                            Margin          = WpfHelper.SmallHorizontalMargin,
                            Padding         = WpfHelper.SmallHorizontalMargin,
                        },
                        (_FilterBox = new SymbolFilterBox(_Menu)),
                    }
                };
                _Menu.Footer = new TextBlock {
                    Margin = WpfHelper.MenuItemMargin
                }
                .ReferenceProperty(TextBlock.ForegroundProperty, EnvironmentColors.SystemGrayTextBrushKey);
                _Bar.SetupSymbolListMenu(_Menu);
                await AddItemsAsync(Node, cancellationToken);

                if (_Menu.Symbols.Count > 100)
                {
                    ScrollViewer.SetCanContentScroll(_Menu, true);
                }
            }
Beispiel #2
0
 bool ISymbolFilter.Filter(int filterTypes)
 {
     return(SymbolFilterBox.FilterByImageId((MemberFilterTypes)filterTypes, _ImageId));
 }