Beispiel #1
0
 public RootItem(CSharpBar bar)
 {
     _Bar = bar;
     Icon = ThemeHelper.GetImage(KnownImageIds.Namespace);
     this.ReferenceCrispImageBackground(EnvironmentColors.MainWindowActiveCaptionColorKey);
     SetResourceReference(ForegroundProperty, VsBrushes.CommandBarTextActiveKey);
     Header = new ThemedToolBarText();
     _Menu  = new SymbolList(bar._SemanticContext)
     {
         Container     = _Bar._SymbolListContainer,
         ContainerType = SymbolListType.NodeList,
         Header        = new StackPanel {
             Margin   = WpfHelper.MenuItemMargin,
             Children =
             {
                 new Separator  {
                     Tag = new ThemedMenuText("Search Declaration")
                 },
                 new StackPanel {
                     Orientation = Orientation.Horizontal,
                     Children    =
                     {
                         ThemeHelper.GetImage(KnownImageIds.SearchContract).WrapMargin(WpfHelper.GlyphMargin),
                         (_FinderBox = new MemberFinderBox()
                         {
                             MinWidth = 150
                         }),
                         (_ScopeBox = new SearchScopeBox{
                             Contents =
                             {
                                 new ThemedButton(KnownImageIds.StopFilter, "Clear filter", ClearFilter).ClearBorder()
                             }
                         }),
                     }
                 },
             }
         },
         Footer = _Note = new TextBlock {
             Margin = WpfHelper.MenuItemMargin
         }
         .ReferenceProperty(TextBlock.ForegroundProperty, EnvironmentColors.SystemGrayTextBrushKey)
     };
     _Bar.SetupSymbolListMenu(_Menu);
     _FinderBox.TextChanged  += SearchCriteriaChanged;
     _ScopeBox.FilterChanged += SearchCriteriaChanged;
     _ScopeBox.FilterChanged += (s, args) => _FinderBox.Focus();
 }
Beispiel #2
0
 public RootItem(CSharpBar bar)
 {
     _Bar = bar;
     Icon = ThemeHelper.GetImage(KnownImageIds.Namespace);
     this.ReferenceCrispImageBackground(EnvironmentColors.MainWindowActiveCaptionColorKey);
     SetResourceReference(ForegroundProperty, VsBrushes.CommandBarTextActiveKey);
     Header        = new ThemedToolBarText();
     SubMenuHeader = new StackPanel {
         Margin   = WpfHelper.MenuItemMargin,
         Children =
         {
             new Separator  {
                 Tag = new ThemedMenuText("Search Declaration")
             },
             new StackPanel {
                 Orientation = Orientation.Horizontal,
                 Children    =
                 {
                     ThemeHelper.GetImage(KnownImageIds.SearchContract).WrapMargin(WpfHelper.GlyphMargin),
                     (_FinderBox = new MemberFinderBox(Items)
                     {
                         MinWidth = 150
                     }),
                     (_ScopeBox = new SearchScopeBox{
                         Contents =
                         {
                             new ThemedButton(KnownImageIds.StopFilter, "Clear filter", ClearFilter).ClearBorder().ClearMargin()
                         }
                     }),
                 }
             },
         }
     };
     SubmenuOpened           += RootItem_SubmenuOpened;
     _FinderBox.TextChanged  += SearchCriteriaChanged;
     _ScopeBox.FilterChanged += SearchCriteriaChanged;
     _ScopeBox.FilterChanged += (s, args) => {
         _FinderBox.Focus();
     };
 }