Skip to content

Commit 7aac086

Browse files
committed
Remove unused code from initial version
1 parent fcf9d42 commit 7aac086

File tree

3 files changed

+4
-155
lines changed

3 files changed

+4
-155
lines changed

RetailCoder.VBE/Navigation/CodeMetrics/CodeMetricsViewModel.cs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@ private void OnStateChanged(object sender, ParserStateEventArgs e)
2525
{
2626
if (e.State == ParserState.Ready)
2727
{
28+
IsBusy = true;
2829
ModuleMetrics = _analyst.ModuleMetrics(_state);
30+
IsBusy = false;
2931
}
3032
}
3133

32-
public void FilterByName(object projects, string text)
33-
{
34-
throw new NotImplementedException();
35-
}
36-
3734
public void Dispose()
3835
{
3936
_state.StateChanged -= OnStateChanged;
@@ -50,21 +47,6 @@ private set
5047
}
5148
}
5249

53-
54-
//public CommandBase RefreshCommand { get; set; }
55-
56-
57-
private bool _canSearch;
58-
public bool CanSearch
59-
{
60-
get => _canSearch;
61-
set
62-
{
63-
_canSearch = value;
64-
OnPropertyChanged();
65-
}
66-
}
67-
6850
private bool _isBusy;
6951
public bool IsBusy
7052
{

RetailCoder.VBE/UI/CodeMetrics/CodeMetricsControl.xaml

Lines changed: 2 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -40,122 +40,17 @@
4040
</LinearGradientBrush>
4141
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
4242
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Black" />
43-
44-
<Style x:Key="XButtonStyle" TargetType="Button">
45-
<Setter Property="Background" Value="Transparent"/>
46-
<Setter Property="Content" Value=""/>
47-
<Setter Property="BorderThickness" Value="0"/>
48-
<Setter Property="HorizontalContentAlignment" Value="Center"/>
49-
<Setter Property="VerticalContentAlignment" Value="Center"/>
50-
<Setter Property="Template">
51-
<Setter.Value>
52-
<ControlTemplate TargetType="Button">
53-
<Grid>
54-
<VisualStateManager.VisualStateGroups>
55-
<VisualStateGroup x:Name="CommonStates">
56-
<VisualState x:Name="Normal"/>
57-
<VisualState x:Name="MouseOver">
58-
<Storyboard>
59-
<ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="PaleGoldenrod"/>
60-
<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity" To="1"/>
61-
</Storyboard>
62-
</VisualState>
63-
<VisualState x:Name="Pressed">
64-
<Storyboard>
65-
<ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="PaleGoldenrod"/>
66-
<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity" To="1"/>
67-
</Storyboard>
68-
</VisualState>
69-
</VisualStateGroup>
70-
<VisualStateGroup x:Name="FocusStates">
71-
<VisualState x:Name="Focused">
72-
<Storyboard>
73-
<DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
74-
</Storyboard>
75-
</VisualState>
76-
<VisualState x:Name="Unfocused" />
77-
</VisualStateGroup>
78-
</VisualStateManager.VisualStateGroups>
79-
<Border x:Name="Background" CornerRadius="3" Background="White" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
80-
<Grid Background="{TemplateBinding Background}" Margin="1">
81-
<Border Opacity="0" x:Name="BackgroundAnimation" Background="PaleGoldenrod" />
82-
</Grid>
83-
</Border>
84-
<ContentPresenter
85-
x:Name="contentPresenter"
86-
Content="{TemplateBinding Content}"
87-
ContentTemplate="{TemplateBinding ContentTemplate}"
88-
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
89-
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
90-
Margin="{TemplateBinding Padding}"/>
91-
<Rectangle x:Name="DisabledVisualElement" RadiusX="3" RadiusY="3" Fill="#FFFFFFFF" Opacity="0" IsHitTestVisible="false" />
92-
<Rectangle x:Name="FocusVisualElement" RadiusX="2" RadiusY="2" Margin="1" Stroke="PaleGoldenrod" StrokeThickness="1" Opacity="0" IsHitTestVisible="false" />
93-
</Grid>
94-
</ControlTemplate>
95-
</Setter.Value>
96-
</Setter>
97-
</Style>
9843
</ResourceDictionary>
9944
</UserControl.Resources>
10045

10146
<Grid UseLayoutRounding="True">
10247
<Grid.RowDefinitions>
103-
<!--<RowDefinition Height="30"/>-->
104-
<RowDefinition Height="20"/>
10548
<RowDefinition Height="*" MinHeight="64" />
10649
</Grid.RowDefinitions>
10750

108-
<!--<ToolBarTray Grid.Row="0" IsLocked="True">
109-
<ToolBar Style="{DynamicResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}">
110-
111-
<Button>
112-
<Image Height="16" Source="../../Resources/arrow-circle-double.png">
113-
<Image.Style>
114-
<Style TargetType="Image">
115-
<Style.Triggers>
116-
<Trigger Property="IsEnabled" Value="False">
117-
<Setter Property="Opacity" Value="0.3" />
118-
</Trigger>
119-
</Style.Triggers>
120-
</Style>
121-
</Image.Style>
122-
</Image>
123-
<Button.ToolTip>
124-
<TextBlock Text="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Refresh}" />
125-
</Button.ToolTip>
126-
</Button>
127-
</ToolBar>
128-
</ToolBarTray>-->
129-
130-
<Border Grid.Row="1"
131-
BorderBrush="{StaticResource {x:Static SystemColors.ControlBrushKey}}"
132-
BorderThickness="1">
133-
<Grid>
134-
<TextBox x:Name="SearchBox"
135-
VerticalContentAlignment="Center"
136-
IsEnabled="{Binding CanSearch}"
137-
MinHeight="20"
138-
PreviewKeyDown="SearchBox_OnPreviewKeyDown"
139-
TextChanged="SearchBox_OnTextChanged" />
140-
141-
<Image Source="{StaticResource SearchImage}"
142-
HorizontalAlignment="Right" VerticalAlignment="Center"
143-
MaxHeight="16" Margin="0,0,1,0"
144-
IsEnabled="{Binding CanSearch}"
145-
Visibility="{Binding ElementName=SearchBox, Path=Text.Length, Converter={StaticResource StringHasValueToVisibility}}"
146-
MouseDown="SearchIcon_OnMouseDown" />
147-
148-
<Button Style="{StaticResource XButtonStyle}"
149-
HorizontalAlignment="Right" VerticalAlignment="Center"
150-
Height="18" Width="18" Margin="0,1,1,0"
151-
IsEnabled="{Binding CanSearch}"
152-
Visibility="{Binding ElementName=SearchBox, Path=Text.Length, Converter={StaticResource StringHasNoValueToVisibility}}"
153-
Click="ButtonBase_OnClick" />
154-
</Grid>
155-
</Border>
156-
<controls:EmptyUIRefresh Grid.Row="2" />
51+
<controls:EmptyUIRefresh Grid.Row="1" />
15752

158-
<DataGrid Grid.Row="2" ItemsSource="{Binding ModuleMetrics}" AutoGenerateColumns="False" IsReadOnly="True">
53+
<DataGrid Grid.Row="1" ItemsSource="{Binding ModuleMetrics}" AutoGenerateColumns="False" IsReadOnly="True">
15954
<DataGrid.Columns>
16055
<DataGridTextColumn Binding="{Binding Path=ModuleName}" Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SearchResults_ModuleName}" Width="*"/>
16156
<DataGridTextColumn Binding="{Binding Path=Result.Lines}" Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeMetrics_Lines}" Width="Auto" x:Name="LinesColumn"/>

RetailCoder.VBE/UI/CodeMetrics/CodeMetricsControl.xaml.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,5 @@ public CodeMetricsControl()
1616
}
1717

1818
private CodeMetricsViewModel ViewModel { get { return DataContext as CodeMetricsViewModel; } }
19-
private void SearchBox_OnTextChanged(object sender, TextChangedEventArgs e)
20-
{
21-
ViewModel.FilterByName(ViewModel.ModuleMetrics, ((TextBox)sender).Text);
22-
}
23-
24-
private void SearchIcon_OnMouseDown(object sender, MouseButtonEventArgs e)
25-
{
26-
SearchBox.Focus();
27-
}
28-
29-
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
30-
{
31-
ClearSearchBox();
32-
}
33-
34-
private void ClearSearchBox()
35-
{
36-
SearchBox.Text = string.Empty;
37-
SearchBox.Focus();
38-
}
39-
40-
private void SearchBox_OnPreviewKeyDown(object sender, KeyEventArgs e)
41-
{
42-
if (e.Key == Key.Escape)
43-
{
44-
ClearSearchBox();
45-
}
46-
}
4719
}
4820
}

0 commit comments

Comments
 (0)