No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
dd68164
... +1 ...
702f18c
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
6 | 6 | xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" |
|
7 | 7 | xmlns:codeExplorer="clr-namespace:Rubberduck.Navigation.CodeExplorer" |
|
8 | - | xmlns:controls="clr-namespace:Rubberduck.UI.Controls" |
|
9 | - | xmlns:converters="clr-namespace:Rubberduck.UI.Converters" |
|
10 | - | xmlns:local="clr-namespace:Rubberduck.UI.CodeExplorer" |
|
8 | + | xmlns:controls="clr-namespace:Rubberduck.UI.Controls;assembly=" |
|
9 | + | xmlns:converters="clr-namespace:Rubberduck.UI.Converters;assembly=" |
|
10 | + | xmlns:local="clr-namespace:Rubberduck.UI.CodeExplorer;assembly=" |
|
11 | 11 | ResxExtension.DefaultResxName="Rubberduck.Resources.CodeExplorer.CodeExplorerUI" |
|
12 | 12 | Language="{UICulture}" |
|
13 | 13 | Name="CodeExplorer" |
48 | 48 | <converters:BoolToHiddenVisibilityConverter x:Key="BoolToHiddenVisibility" /> |
|
49 | 49 | <converters:BooleanToDimmedBrushConverter x:Key="BooleanToDimmed" /> |
|
50 | 50 | <converters:TemplateCommandParameterToTupleConverter x:Key="TemplateCommandParameterToTuple" /> |
|
51 | - | <converters:SearchImageSourceConverter x:Key="SearchToIcon" /> |
|
52 | 51 | <converters:InvertBoolValueConverter x:Key="NotBool" /> |
|
53 | 52 | <converters:CodeExplorerNodeToIconConverter x:Key="NodeToIcon" /> |
|
54 | 53 | <converters:AccessibilityToIconConverter x:Key="AccessibilityToIcon" /> |
64 | 63 | <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" /> |
|
65 | 64 | <SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Black" /> |
|
66 | 65 | ||
67 | - | <Style x:Key="PlaceHolder" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}"> |
|
68 | - | <Setter Property="Template"> |
|
69 | - | <Setter.Value> |
|
70 | - | <ControlTemplate TargetType="{x:Type TextBox}"> |
|
71 | - | <Grid> |
|
72 | - | <TextBox Text="{Binding Path=Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
|
73 | - | x:Name="textSource" |
|
74 | - | Background="Transparent" |
|
75 | - | Panel.ZIndex="2" |
|
76 | - | VerticalContentAlignment="Center"/> |
|
77 | - | <TextBox Text="{TemplateBinding Tag}" Background="{TemplateBinding Background}" Panel.ZIndex="1"> |
|
78 | - | <TextBox.Style> |
|
79 | - | <Style TargetType="{x:Type TextBox}"> |
|
80 | - | <Setter Property="Foreground" Value="Transparent"/> |
|
81 | - | <Setter Property="VerticalContentAlignment" Value="Center"/> |
|
82 | - | <Style.Triggers> |
|
83 | - | <DataTrigger Binding="{Binding Path=Text, Source={x:Reference textSource}}" Value=""> |
|
84 | - | <Setter Property="Foreground" Value="LightGray"/> |
|
85 | - | </DataTrigger> |
|
86 | - | </Style.Triggers> |
|
87 | - | </Style> |
|
88 | - | </TextBox.Style> |
|
89 | - | </TextBox> |
|
90 | - | </Grid> |
|
91 | - | </ControlTemplate> |
|
92 | - | </Setter.Value> |
|
93 | - | </Setter> |
|
94 | - | <Setter Property="Margin" Value="0" /> |
|
95 | - | <Setter Property="VerticalAlignment" Value="Center" /> |
|
96 | - | </Style> |
|
97 | - | ||
98 | 66 | <CompositeCollection x:Key="AddModuleCommands"> |
|
99 | 67 | <MenuItem Header="{Resx ResxName=Rubberduck.Resources.CodeExplorer.CodeExplorerUI, Key=CodeExplorer_AddVBFormText}" |
|
100 | 68 | Command="{Binding AddVBFormCommand}" |
419 | 387 | BorderBrush="{x:Static SystemColors.ActiveBorderBrush}" |
|
420 | 388 | BorderThickness="1" |
|
421 | 389 | Padding="2"> |
|
422 | - | <Grid> |
|
423 | - | <Grid.ColumnDefinitions> |
|
424 | - | <ColumnDefinition Width="*" /> |
|
425 | - | <ColumnDefinition Width="20" /> |
|
426 | - | </Grid.ColumnDefinitions> |
|
427 | - | <TextBox Name="SearchBox" Grid.Column="0"> |
|
428 | - | <TextBox.Style> |
|
429 | - | <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource PlaceHolder}"> |
|
430 | - | <Setter Property="Height" Value="20" /> |
|
431 | - | <Setter Property="Width" Value="Auto" /> |
|
432 | - | <Setter Property="Tag" Value="{Resx ResxName=Rubberduck.Resources.CodeExplorer.CodeExplorerUI, Key=CodeExplorer_SearchPlaceholder}" /> |
|
433 | - | <Setter Property="Text" Value="{Binding Search, UpdateSourceTrigger=PropertyChanged}" /> |
|
434 | - | </Style> |
|
435 | - | </TextBox.Style> |
|
436 | - | </TextBox> |
|
437 | - | <Button Name="SearchButton" Grid.Column="1" Command="{Binding ClearSearchCommand}" |
|
438 | - | BorderBrush="{x:Static SystemColors.ControlLightBrush}" |
|
439 | - | Background="Transparent" |
|
440 | - | Width="20" Height="20" Padding="0" Margin="0,1"> |
|
441 | - | <Image VerticalAlignment="Center" HorizontalAlignment="Center" |
|
442 | - | Width="16" Height="16" Source="{Binding Search, Converter={StaticResource SearchToIcon}, UpdateSourceTrigger=PropertyChanged}" /> |
|
443 | - | <i:Interaction.Behaviors> |
|
444 | - | <controls:FocusElementAfterClickBehavior FocusElement="{Binding ElementName=SearchBox, Mode=OneWay}"/> |
|
445 | - | </i:Interaction.Behaviors> |
|
446 | - | </Button> |
|
447 | - | </Grid> |
|
390 | + | <controls:SearchBox x:Name="SearchBox" |
|
391 | + | Background="{x:Static SystemColors.WindowBrush}" |
|
392 | + | Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
|
393 | + | Hint="{Resx ResxName=Rubberduck.Resources.CodeExplorer.CodeExplorerUI, |
|
394 | + | Key=CodeExplorer_SearchPlaceholder}" |
|
395 | + | Grid.Column="0" |
|
396 | + | Width="Auto"/> |
|
448 | 397 | </Border> |
|
449 | 398 | ||
450 | 399 | <TreeView x:Name="ProjectTree" |
1 | + | <UserControl x:Class="Rubberduck.UI.Controls.SearchBox" |
|
2 | + | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
3 | + | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
4 | + | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
5 | + | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
6 | + | xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" |
|
7 | + | xmlns:local="clr-namespace:Rubberduck.UI.Controls;assembly=" |
|
8 | + | xmlns:ib="clr-namespace:Rubberduck.UI.Controls.Behavior;assembly=" |
|
9 | + | xmlns:converters="clr-namespace:Rubberduck.UI.Converters;assembly=" |
|
10 | + | mc:Ignorable="d" |
|
11 | + | MinWidth="50" MinHeight="20" |
|
12 | + | Height="20" |
|
13 | + | Name="Root" |
|
14 | + | d:DesignHeight="20" d:DesignWidth="400" |
|
15 | + | d:DataContext="{d:DesignInstance local:SearchBox, IsDesignTimeCreatable=True}"> |
|
16 | + | <Grid> |
|
17 | + | <Grid.ColumnDefinitions> |
|
18 | + | <ColumnDefinition Width="*"/> |
|
19 | + | <ColumnDefinition Width="20" /> |
|
20 | + | </Grid.ColumnDefinitions> |
|
21 | + | <TextBox Text="{Binding Path=Text, ElementName=Root, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
|
22 | + | x:Name="ValueContainer" |
|
23 | + | Background="Transparent" |
|
24 | + | Panel.ZIndex="2" |
|
25 | + | VerticalContentAlignment="Center" |
|
26 | + | Width="Auto" |
|
27 | + | Grid.Row="0" Grid.Column="0"/> |
|
28 | + | <!-- this is the actual hint container, it's BELOW the displaying control --> |
|
29 | + | <TextBox Text="{Binding Path=Hint, ElementName=Root, Mode=OneWay}" |
|
30 | + | Background="{Binding Path=Background, ElementName=Root}" |
|
31 | + | Width="{Binding Path=ActualWidth, ElementName=ValueContainer}" |
|
32 | + | Height="{Binding Path=ActualHeight, ElementName=ValueContainer}" |
|
33 | + | Panel.ZIndex="1" |
|
34 | + | VerticalContentAlignment="Center" |
|
35 | + | Grid.Row="0" Grid.Column="0"> |
|
36 | + | <TextBox.Style> |
|
37 | + | <Style TargetType="{x:Type TextBox}"> |
|
38 | + | <!-- Setter needs to be within this type to be overwritable with a trigger --> |
|
39 | + | <Setter Property="Foreground" Value="Transparent" /> |
|
40 | + | <Style.Triggers> |
|
41 | + | <DataTrigger Binding="{Binding Path=Text, Source={x:Reference ValueContainer}}" Value=""> |
|
42 | + | <Setter Property="Foreground" Value="{x:Static SystemColors.GrayTextBrush}"/> |
|
43 | + | </DataTrigger> |
|
44 | + | </Style.Triggers> |
|
45 | + | </Style> |
|
46 | + | </TextBox.Style> |
|
47 | + | </TextBox> |
|
48 | + | <Button Name="SearchButton" Grid.Column="1" Command="{Binding ClearSearchCommand}" |
|
49 | + | BorderBrush="{x:Static SystemColors.ControlLightBrush}" |
|
50 | + | Background="Transparent" |
|
51 | + | Width="20" Height="20" Padding="0" Margin="0,1" |
|
52 | + | xmlns:sys="clr-namespace:System;assembly=mscorlib"> |
|
53 | + | <Button.Resources> |
|
54 | + | <converters:SearchImageSourceConverter x:Key="SearchToIcon" /> |
|
55 | + | </Button.Resources> |
|
56 | + | <Image VerticalAlignment="Center" HorizontalAlignment="Center" |
|
57 | + | Width="16" Height="16" |
|
58 | + | Source="{Binding Text, ElementName=ValueContainer, |
|
59 | + | Converter={StaticResource SearchToIcon}, |
|
60 | + | UpdateSourceTrigger=PropertyChanged}" /> |
|
61 | + | <i:Interaction.Behaviors> |
|
62 | + | <local:FocusElementAfterClickBehavior FocusElement="{x:Reference ValueContainer}"/> |
|
63 | + | <ib:ResetValueBehavior Affects="{Binding Path=Text, ElementName=ValueContainer, Mode=OneWayToSource}" |
|
64 | + | Default="{x:Static sys:String.Empty}"/> |
|
65 | + | </i:Interaction.Behaviors> |
|
66 | + | </Button> |
|
67 | + | </Grid> |
|
68 | + | </UserControl> |
1 | + | using NLog; |
|
2 | + | using Rubberduck.UI.Command; |
|
3 | + | using System; |
|
4 | + | using System.Collections.Generic; |
|
5 | + | using System.Linq; |
|
6 | + | using System.Text; |
|
7 | + | using System.Threading.Tasks; |
|
8 | + | using System.Windows; |
|
9 | + | using System.Windows.Controls; |
|
10 | + | using System.Windows.Data; |
|
11 | + | using System.Windows.Documents; |
|
12 | + | using System.Windows.Input; |
|
13 | + | using System.Windows.Media; |
|
14 | + | using System.Windows.Media.Imaging; |
|
15 | + | using System.Windows.Navigation; |
|
16 | + | using System.Windows.Shapes; |
|
17 | + | ||
18 | + | namespace Rubberduck.UI.Controls |
|
19 | + | { |
|
20 | + | /// <summary> |
|
21 | + | /// Interaction logic for SearchBox.xaml |
|
22 | + | /// </summary> |
|
23 | + | public partial class SearchBox : UserControl |
|
24 | + | { |
|
25 | + | public static readonly DependencyProperty TextProperty = |
|
26 | + | DependencyProperty.Register(nameof(Text), typeof(string), typeof(SearchBox), new UIPropertyMetadata(default(string), PropertyChangedCallback)); |
|
27 | + | public static readonly DependencyProperty HintProperty = |
|
28 | + | DependencyProperty.Register(nameof(Hint), typeof(string), typeof(SearchBox), new UIPropertyMetadata(default(string), PropertyChangedCallback)); |
|
29 | + | ||
30 | + | private static void PropertyChangedCallback(DependencyObject source, DependencyPropertyChangedEventArgs e) |
|
31 | + | { |
|
32 | + | if (source is SearchBox control) |
|
33 | + | { |
|
34 | + | var newValue = (string)e.NewValue; |
|
35 | + | switch (e.Property.Name) |
|
36 | + | { |
|
37 | + | case "Text": |
|
38 | + | control.Text = newValue; |
|
39 | + | break; |
|
40 | + | case "Hint": |
|
41 | + | control.Hint = newValue; |
|
42 | + | break; |
|
43 | + | } |
|
44 | + | } |
|
45 | + | } |
|
46 | + | ||
47 | + | public string Text |
|
48 | + | { |
|
49 | + | get => (string)GetValue(TextProperty); |
|
50 | + | set |
|
51 | + | { |
|
52 | + | var old = GetValue(TextProperty); |
|
53 | + | SetValue(TextProperty, value); |
|
54 | + | OnPropertyChanged(new DependencyPropertyChangedEventArgs(TextProperty, old, value)); |
|
55 | + | } |
|
56 | + | } |
|
57 | + | public string Hint |
|
58 | + | { |
|
59 | + | get => (string)GetValue(HintProperty); |
|
60 | + | set |
|
61 | + | { |
|
62 | + | var old = GetValue(HintProperty); |
|
63 | + | SetValue(HintProperty, value); |
|
64 | + | OnPropertyChanged(new DependencyPropertyChangedEventArgs(HintProperty, old, value)); |
|
65 | + | } |
|
66 | + | } |
|
67 | + | ||
68 | + | public ICommand ClearSearchCommand { get => new DelegateCommand(LogManager.GetCurrentClassLogger(), (arg) => Text = ""); } |
|
69 | + | ||
70 | + | public SearchBox() |
|
71 | + | { |
|
72 | + | // design instance! |
|
73 | + | Text = ""; |
|
74 | + | Hint = "Search"; |
|
75 | + | Width = 300; |
|
76 | + | Height = 25; |
|
77 | + | Background = SystemColors.WindowBrush; |
|
78 | + | // not so much design instance |
|
79 | + | InitializeComponent(); |
|
80 | + | } |
|
81 | + | } |
|
82 | + | } |
Learn more Showing 4 files with coverage changes found.
Rubberduck.Core/UI/Controls/SearchBox.xaml.cs
Rubberduck.Core/UI/Controls/Behavior/ResetValueBehavior.cs
Rubberduck.Core/UI/Controls/SearchBox.xaml
Rubberduck.Parsing/VBA/RubberduckParserState.cs
Files | Coverage |
---|---|
Project Totals (1068 files) | 64.47% |
702f18c
4999e44
dd68164