Skip to content

Commit 5405556

Browse files
committed
Add headers count to statistic
1 parent bdfa718 commit 5405556

File tree

4 files changed

+29
-22
lines changed

4 files changed

+29
-22
lines changed

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@
291291
<system:String x:Key="String_ForkMeOnGitHub">Fork me on Github!</system:String>
292292
<system:String x:Key="String_Documentation">Dokumentation</system:String>
293293
<system:String x:Key="String_Version">Version</system:String>
294-
294+
<system:String x:Key="String_Headers">Headers</system:String>
295+
295296
<!-- Help message -->
296297
<system:String x:Key="String_HelpMessage_ParameterHelp">Zeigt diesen Dialog an.</system:String>
297298
<system:String x:Key="String_HelpMessage_ParameterResetSettings">Setzt alle Einstellungen zurück.</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@
291291
<system:String x:Key="String_ForkMeOnGitHub">Fork me on Github!</system:String>
292292
<system:String x:Key="String_Documentation">Documentation</system:String>
293293
<system:String x:Key="String_Version">Version</system:String>
294+
<system:String x:Key="String_Headers">Headers</system:String>
294295

295296
<!-- Help message -->
296297
<system:String x:Key="String_HelpMessage_ParameterHelp">Displays this dialog.</system:String>

Source/NETworkManager/ViewModels/Applications/HTTPHeadersViewModel.cs

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ public bool IsCheckRunning
6767
}
6868
}
6969

70-
private string _headerResult;
71-
public string HeaderResult
70+
private string _headers;
71+
public string Headers
7272
{
73-
get { return _headerResult; }
73+
get { return _headers; }
7474
set
7575
{
76-
if (value == _headerResult)
76+
if (value == _headers)
7777
return;
7878

79-
_headerResult = value;
79+
_headers = value;
8080
OnPropertyChanged();
8181
}
8282
}
@@ -151,6 +151,20 @@ public DateTime? EndTime
151151
}
152152
}
153153

154+
private int _headersCount;
155+
public int HeadersCount
156+
{
157+
get { return _headersCount; }
158+
set
159+
{
160+
if (value == _headersCount)
161+
return;
162+
163+
_headersCount = value;
164+
OnPropertyChanged();
165+
}
166+
}
167+
154168
private bool _expandStatistics;
155169
public bool ExpandStatistics
156170
{
@@ -213,15 +227,15 @@ private async void Check()
213227
dispatcherTimer.Start();
214228
EndTime = null;
215229

216-
HeaderResult = null;
230+
Headers = null;
231+
HeadersCount = 0;
217232

218233
try
219234
{
220235
WebHeaderCollection headers = await HTTPHeaders.GetHeadersAsync(new Uri(WebsiteUri));
221236

222-
HeaderResult = headers.ToString();
223-
//headers.Count;
224-
237+
Headers = headers.ToString();
238+
HeadersCount = headers.Count;
225239
}
226240
catch (Exception ex)
227241
{

Source/NETworkManager/Views/Applications/HTTPHeadersView.xaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<TextBlock Grid.Row="2" Foreground="{DynamicResource AccentColorBrush}" Text="{Binding StatusMessage}" Visibility="{Binding DisplayStatusMessage, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource DefaultTextBlock}" Margin="0,10,0,0" />
9797
</Grid>
9898
<TextBlock Grid.Row="2" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_Header_Headers}" />
99-
<TextBox Grid.Row="3" Text="{Binding HeaderResult}" Style="{StaticResource DefaultTextBox}" FontFamily="Consolas" IsReadOnly="True" ContextMenu="{StaticResource CopyContextMenu}" Margin="0,0,0,20"/>
99+
<TextBox Grid.Row="3" Text="{Binding Headers}" Style="{StaticResource DefaultTextBox}" FontFamily="Consolas" IsReadOnly="True" ContextMenu="{StaticResource CopyContextMenu}" Margin="0,0,0,20"/>
100100
<Expander Grid.Row="4" IsExpanded="{Binding ExpandStatistics}" Style="{StaticResource DefaultExpander}">
101101
<Expander.Header>
102102
<TextBlock Text="{DynamicResource String_Header_Statistics}" Style="{StaticResource HeaderTextBlock}" Margin="0" />
@@ -129,17 +129,8 @@
129129
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Duration, StringFormat={}{0:hh}h {0:mm}m {0:ss}s {0:ff}ms}" />
130130
<TextBlock Grid.Column="0" Grid.Row="2" Text="{DynamicResource String_EndTime}" />
131131
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding EndTime, Converter={StaticResource NullableDateTimeToStringConverter}}" />
132-
<!--<TextBlock Grid.Column="3" Grid.Row="0" Text="{DynamicResource String_Scanned}" />
133-
<TextBox Grid.Column="4" Grid.Row="0">
134-
<TextBox.Text>
135-
<MultiBinding StringFormat="{}{0} / {1}">
136-
<Binding Path="IPAddressesScanned" />
137-
<Binding Path="IPAddressesToScan" />
138-
</MultiBinding>
139-
</TextBox.Text>
140-
</TextBox>
141-
<TextBlock Grid.Column="3" Grid.Row="1" Text="{DynamicResource String_Found}" />
142-
<TextBox Grid.Column="4" Grid.Row="1" Text="{Binding HostsFound}" />-->
132+
<TextBlock Grid.Column="3" Grid.Row="0" Text="{DynamicResource String_Headers}" />
133+
<TextBox Grid.Column="4" Grid.Row="0" Text="{Binding HeadersCount}" />
143134
</Grid>
144135
</StackPanel>
145136
</Expander>

0 commit comments

Comments
 (0)