Skip to content

Commit 70b3eff

Browse files
committed
v2c view
1 parent 9fbd202 commit 70b3eff

6 files changed

Lines changed: 260 additions & 133 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
<system:String x:Key="String_Header_v3">v3</system:String>
102102
<system:String x:Key="String_Header_HTTPHeaders">HTTP-Headers</system:String>
103103
<system:String x:Key="String_Header_Network">Netzwerk</system:String>
104+
<system:String x:Key="String_Header_Data">Daten</system:String>
104105

105106
<!-- Normal strings -->
106107
<system:String x:Key="String_ProductName">NETworkManager</system:String>
@@ -419,6 +420,7 @@
419420
<system:String x:Key="String_Button_DecryptAndLoad">Entschlüsseln und laden...</system:String>
420421
<system:String x:Key="String_Button_Query">Abfragen</system:String>
421422
<system:String x:Key="String_Button_Open">Öffnen</system:String>
423+
<system:String x:Key="String_Button_Send">Senden</system:String>
422424
<system:String x:Key="String_Button_CheckForUpdaptes">Auf Updates prüfen</system:String>
423425

424426
<!-- ContextMenuItem.Header -->

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
<system:String x:Key="String_Header_v3">v3</system:String>
102102
<system:String x:Key="String_Header_HTTPHeaders">HTTP Headers</system:String>
103103
<system:String x:Key="String_Header_Network">Network</system:String>
104+
<system:String x:Key="String_Header_Data">Data</system:String>
104105

105106
<!-- Normal strings -->
106107
<system:String x:Key="String_ProductName">NETworkManager</system:String>
@@ -419,6 +420,7 @@
419420
<system:String x:Key="String_Button_DecryptAndLoad">Decrypt and load...</system:String>
420421
<system:String x:Key="String_Button_Query">Query</system:String>
421422
<system:String x:Key="String_Button_Open">Open</system:String>
423+
<system:String x:Key="String_Button_Send">Send</system:String>
422424
<system:String x:Key="String_Button_CheckForUpdaptes">Check for updates</system:String>
423425

424426
<!-- ContextMenuItem.Header -->

Source/NETworkManager/Resources/Styles/TextBoxStyles.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
<!-- Apply the default design to all text boxes -->
1414
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}" />
1515

16+
<Style x:Key="ConsoleTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}">
17+
<Setter Property="FontFamily" Value="Consolas" />
18+
<Setter Property="VerticalContentAlignment" Value="Top" />
19+
</Style>
20+
1621
<Style x:Key="SearchTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource SearchMetroTextBox}">
1722
<Setter Property="FontSize" Value="14" />
1823
<Setter Property="BorderBrush" Value="{DynamicResource GrayBrush8}" />

Source/NETworkManager/ViewModels/Applications/SNMPv1v2cViewModel.cs

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,30 @@ public string Community
117117
}
118118
}
119119

120-
private bool _isQueryRunning;
121-
public bool IsQueryRunning
120+
private string _data;
121+
public string Data
122122
{
123-
get { return _isQueryRunning; }
123+
get { return _data; }
124124
set
125125
{
126-
if (value == _isQueryRunning)
126+
if (value == _data)
127127
return;
128128

129-
_isQueryRunning = value;
129+
_data = value;
130+
OnPropertyChanged();
131+
}
132+
}
133+
134+
private bool _isWorking;
135+
public bool IsWorking
136+
{
137+
get { return _isWorking; }
138+
set
139+
{
140+
if (value == _isWorking)
141+
return;
142+
143+
_isWorking = value;
130144
OnPropertyChanged();
131145
}
132146
}
@@ -291,7 +305,7 @@ public SNMPv1v2cViewModel()
291305
private void LoadSettings()
292306
{
293307
Version = Versions.FirstOrDefault(x => x == SettingsManager.Current.SNMP_v1v2c_Version);
294-
Mode = Modes.FirstOrDefault(x => x == SettingsManager.Current.SNMP_v1v2c_Mode);
308+
Mode = Modes.FirstOrDefault(x => x == SettingsManager.Current.SNMP_v1v2c_Mode);
295309
ExpandStatistics = SettingsManager.Current.SNMP_v1v2c_ExpandStatistics;
296310
}
297311
#endregion
@@ -333,7 +347,7 @@ private void CopySelectedDataAction()
333347
private async void Query()
334348
{
335349
DisplayStatusMessage = false;
336-
IsQueryRunning = true;
350+
IsWorking = true;
337351

338352
// Measure time
339353
StartTime = DateTime.Now;
@@ -406,7 +420,7 @@ private async void Query()
406420
snmp.UserHasCanceled += Snmp_UserHasCanceled;
407421
snmp.Complete += Snmp_Complete;
408422

409-
switch(Mode)
423+
switch (Mode)
410424
{
411425
case SNMPMode.Get:
412426
snmp.Getv1v2cAsync(Version, ipAddress, Community, OID, snmpOptions);
@@ -423,7 +437,7 @@ private async void Query()
423437

424438
private void QueryFinished()
425439
{
426-
IsQueryRunning = false;
440+
IsWorking = false;
427441

428442
// Stop timer and stopwatch
429443
stopwatch.Stop();
@@ -447,7 +461,7 @@ private void AddHostToHistory(string host)
447461
// Fill with the new items
448462
list.ForEach(x => SettingsManager.Current.SNMP_v1v2c_HostHistory.Add(x));
449463
}
450-
464+
451465
private void AddOIDToHistory(string oid)
452466
{
453467
// Create the new list

Source/NETworkManager/Views/Applications/HTTPHeadersView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<TextBlock Grid.Row="2" Foreground="{DynamicResource AccentColorBrush}" Text="{Binding StatusMessage}" Visibility="{Binding DisplayStatusMessage, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource DefaultTextBlock}" Margin="0,10,0,0" />
100100
</Grid>
101101
<TextBlock Grid.Row="2" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_Header_Headers}" />
102-
<TextBox Grid.Row="3" Text="{Binding Headers}" Style="{StaticResource DefaultTextBox}" FontFamily="Consolas" IsReadOnly="True" VerticalContentAlignment="Top" ContextMenu="{StaticResource CopyContextMenu}" Margin="0,0,0,20"/>
102+
<TextBox Grid.Row="3" Text="{Binding Headers}" Style="{StaticResource ConsoleTextBox}" IsReadOnly="True" ContextMenu="{StaticResource CopyContextMenu}" Margin="0,0,0,20"/>
103103
<Expander Grid.Row="4" IsExpanded="{Binding ExpandStatistics}" Style="{StaticResource HeaderExpander}">
104104
<Expander.Header>
105105
<TextBlock Text="{DynamicResource String_Header_Statistics}" Style="{StaticResource HeaderTextBlock}" Margin="0" />

0 commit comments

Comments
 (0)