Skip to content

Commit 1de6c57

Browse files
committed
RemoteDesktop - some settings added
1 parent 8d7a212 commit 1de6c57

7 files changed

Lines changed: 208 additions & 10 deletions

File tree

Source/NETworkManager/Controls/RemoteDesktopControl.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public RemoteDesktopControl(RemoteDesktopSessionInfo info)
7777
// AdvancedSettings
7878
rdpClient.AdvancedSettings9.AuthenticationLevel = 2;
7979
rdpClient.AdvancedSettings9.EnableCredSspSupport = true;
80+
81+
// Devices and resources
8082
rdpClient.AdvancedSettings9.RedirectClipboard = false;
8183
rdpClient.AdvancedSettings9.RedirectDevices = false;
8284
rdpClient.AdvancedSettings9.RedirectDrives = false;

Source/NETworkManager/Models/Settings/SettingsInfo.cs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,90 @@ public List<string> SubnetCalculator_IPv4Splitter_NewSubnetmaskOrCIDRHistory
10951095
#endregion
10961096

10971097
#region RemoteDesktop
1098+
private bool _remoteDesktop_RedirectClipboard = true;
1099+
public bool RemoteDesktop_RedirectClipboard
1100+
{
1101+
get { return _remoteDesktop_RedirectClipboard; }
1102+
set
1103+
{
1104+
if (value == _remoteDesktop_RedirectClipboard)
1105+
return;
1106+
1107+
_remoteDesktop_RedirectClipboard = value;
1108+
SettingsChanged = true;
1109+
}
1110+
}
1111+
1112+
private bool _remoteDesktop_RedirectDevices;
1113+
public bool RemoteDesktop_RedirectDevices
1114+
{
1115+
get { return _remoteDesktop_RedirectDevices; }
1116+
set
1117+
{
1118+
if (value == _remoteDesktop_RedirectDevices)
1119+
return;
1120+
1121+
_remoteDesktop_RedirectDevices = value;
1122+
SettingsChanged = true;
1123+
}
1124+
}
1125+
1126+
private bool _remoteDesktop_RedirectDrives;
1127+
public bool RemoteDesktop_RedirectDrives
1128+
{
1129+
get { return _remoteDesktop_RedirectDrives; }
1130+
set
1131+
{
1132+
if (value == _remoteDesktop_RedirectDrives)
1133+
return;
1134+
1135+
_remoteDesktop_RedirectDrives = value;
1136+
SettingsChanged = true;
1137+
}
1138+
}
1139+
1140+
private bool _remoteDesktop_RedirectPorts;
1141+
public bool RemoteDesktop_RedirectPorts
1142+
{
1143+
get { return _remoteDesktop_RedirectPorts; }
1144+
set
1145+
{
1146+
if (value == _remoteDesktop_RedirectPorts)
1147+
return;
1148+
1149+
_remoteDesktop_RedirectPorts = value;
1150+
SettingsChanged = true;
1151+
}
1152+
}
1153+
1154+
private bool _remoteDesktop_RedirectSmartcards;
1155+
public bool RemoteDesktop_RedirectSmartcards
1156+
{
1157+
get { return _remoteDesktop_RedirectSmartcards; }
1158+
set
1159+
{
1160+
if (value == _remoteDesktop_RedirectSmartcards)
1161+
return;
1162+
1163+
_remoteDesktop_RedirectSmartcards = value;
1164+
SettingsChanged = true;
1165+
}
1166+
}
1167+
1168+
private bool _remoteDesktop_RedirectPrinters;
1169+
public bool RemoteDesktop_RedirectPrinters
1170+
{
1171+
get { return _remoteDesktop_RedirectPrinters; }
1172+
set
1173+
{
1174+
if (value == _remoteDesktop_RedirectPrinters)
1175+
return;
1176+
1177+
_remoteDesktop_RedirectPrinters = value;
1178+
SettingsChanged = true;
1179+
}
1180+
}
1181+
10981182
private bool _remoteDesktop_ExpandSessionView = true;
10991183
public bool RemoteDesktop_ExpandSessionView
11001184
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
<system:String x:Key="String_Header_Sessions">Sitzungen</system:String>
7676
<system:String x:Key="String_Header_RemoteDesktop">Remote Desktop</system:String>
7777
<system:String x:Key="String_Header_Disconnected">Getrennt</system:String>
78-
78+
<system:String x:Key="String_Header_LocalDevicesAndResources">Lokale Geräte und Ressourcen</system:String>
79+
7980
<!-- Normal strings -->
8081
<system:String x:Key="String_ProductName">NETworkManager</system:String>
8182
<system:String x:Key="String_Slogan">Ein leistungsstarkes Tool zum Verwalten von Netzwerken und zur Behebung von Netzwerkproblemen!</system:String>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@
7575
<system:String x:Key="String_Header_Sessions">Sessions</system:String>
7676
<system:String x:Key="String_Header_RemoteDesktop">Remote Desktop</system:String>
7777
<system:String x:Key="String_Header_Disconnected">Disconnected</system:String>
78+
<system:String x:Key="String_Header_LocalDevicesAndResources">Local devices and resources</system:String>
7879

79-
<!-- Normal strings -->
80+
<!-- Normal strings -->
8081
<system:String x:Key="String_ProductName">NETworkManager</system:String>
8182
<system:String x:Key="String_Slogan">A powerful tool for managing networks and troubleshoot network problems!</system:String>
8283
<system:String x:Key="String_Settings">Settings</system:String>

Source/NETworkManager/ViewModels/Settings/SettingsApplicationRemoteDesktopViewModel.cs

Lines changed: 108 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,109 @@ namespace NETworkManager.ViewModels.Settings
99
public class SettingsApplicationRemoteDesktopViewModel : ViewModelBase
1010
{
1111
#region Variables
12-
#pragma warning disable CS0414 // The field 'SettingsApplicationRemoteDesktopViewModel._isLoading' is assigned but its value is never used
1312
private bool _isLoading = true;
14-
#pragma warning restore CS0414 // The field 'SettingsApplicationRemoteDesktopViewModel._isLoading' is assigned but its value is never used
13+
14+
private bool _redirectClipboard;
15+
public bool RedirectClipboard
16+
{
17+
get { return _redirectClipboard; }
18+
set
19+
{
20+
if (value == _redirectClipboard)
21+
return;
22+
23+
if (!_isLoading)
24+
SettingsManager.Current.RemoteDesktop_RedirectClipboard = value;
25+
26+
_redirectClipboard = value;
27+
OnPropertyChanged();
28+
}
29+
}
30+
31+
private bool _redirectDevices;
32+
public bool RedirectDevices
33+
{
34+
get { return _redirectDevices; }
35+
set
36+
{
37+
if (value == _redirectDevices)
38+
return;
39+
40+
if (!_isLoading)
41+
SettingsManager.Current.RemoteDesktop_RedirectDevices = value;
42+
43+
_redirectDevices = value;
44+
OnPropertyChanged();
45+
}
46+
}
47+
48+
private bool _redirectDrives;
49+
public bool RedirectDrives
50+
{
51+
get { return _redirectDrives; }
52+
set
53+
{
54+
if (value == _redirectDrives)
55+
return;
56+
57+
if (!_isLoading)
58+
SettingsManager.Current.RemoteDesktop_RedirectDrives = value;
59+
60+
_redirectDrives = value;
61+
OnPropertyChanged();
62+
}
63+
}
64+
65+
private bool _redirectPorts;
66+
public bool RedirectPorts
67+
{
68+
get { return _redirectPorts; }
69+
set
70+
{
71+
if (value == _redirectPorts)
72+
return;
73+
74+
if (!_isLoading)
75+
SettingsManager.Current.RemoteDesktop_RedirectPorts = value;
76+
77+
_redirectPorts = value;
78+
OnPropertyChanged();
79+
}
80+
}
81+
82+
private bool _redirectSmartcards;
83+
public bool RedirectSmartcards
84+
{
85+
get { return _redirectSmartcards; }
86+
set
87+
{
88+
if (value == _redirectSmartcards)
89+
return;
90+
91+
if (!_isLoading)
92+
SettingsManager.Current.RemoteDesktop_RedirectSmartcards = value;
93+
94+
_redirectSmartcards = value;
95+
OnPropertyChanged();
96+
}
97+
}
98+
99+
private bool _redirectPrinters;
100+
public bool RedirectPrinters
101+
{
102+
get { return _redirectPrinters; }
103+
set
104+
{
105+
if (value == _redirectPrinters)
106+
return;
107+
108+
if (!_isLoading)
109+
SettingsManager.Current.RemoteDesktop_RedirectPrinters = value;
110+
111+
_redirectPrinters = value;
112+
OnPropertyChanged();
113+
}
114+
}
15115
#endregion
16116

17117
#region Constructor, load settings
@@ -24,7 +124,12 @@ public SettingsApplicationRemoteDesktopViewModel()
24124

25125
private void LoadSettings()
26126
{
27-
127+
RedirectClipboard = SettingsManager.Current.RemoteDesktop_RedirectClipboard;
128+
RedirectDevices = SettingsManager.Current.RemoteDesktop_RedirectDevices;
129+
RedirectDrives = SettingsManager.Current.RemoteDesktop_RedirectDrives;
130+
RedirectPorts = SettingsManager.Current.RemoteDesktop_RedirectPorts;
131+
RedirectSmartcards = SettingsManager.Current.RemoteDesktop_RedirectSmartcards;
132+
RedirectPrinters = SettingsManager.Current.RemoteDesktop_RedirectPrinters;
28133
}
29134
#endregion
30135
}

Source/NETworkManager/Views/Settings/SettingsApplicationDNSLookupView.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
</TextBox.Text>
2121
</TextBox>
2222
<TextBlock Text="{DynamicResource String_Class}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
23-
<ComboBox FontSize="14" ItemsSource="{Binding Classes}" SelectedItem="{Binding Class}" Width="250" HorizontalAlignment="Left" Margin="0,0,0,10"/>
23+
<ComboBox ItemsSource="{Binding Classes}" SelectedItem="{Binding Class}" Width="250" HorizontalAlignment="Left" Margin="0,0,0,10"/>
2424
<TextBlock Text="{DynamicResource String_Type}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
25-
<ComboBox FontSize="14" ItemsSource="{Binding Types}" SelectedItem="{Binding Type}" Width="250" HorizontalAlignment="Left" Margin="0,0,0,10"/>
25+
<ComboBox ItemsSource="{Binding Types}" SelectedItem="{Binding Type}" Width="250" HorizontalAlignment="Left" Margin="0,0,0,10"/>
2626
<mah:ToggleSwitch Header="{DynamicResource String_AddDNSSuffixToHostname}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding AddDNSSuffix}" Margin="0,0,0,10"/>
2727
<mah:ToggleSwitch Header="{DynamicResource String_UseCustomDNSSuffix}" IsEnabled="{Binding AddDNSSuffix}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding UseCustomDNSSuffix}" Margin="0,0,0,10"/>
2828
<TextBox Width="250" HorizontalAlignment="Left" Margin="0,0,0,10">
@@ -54,7 +54,7 @@
5454
<mah:ToggleSwitch Header="{DynamicResource String_Recursion}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding Recursion}" Margin="0,0,0,10"/>
5555
<mah:ToggleSwitch Header="{DynamicResource String_UseResolverCache}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding UseResolverCache}" Margin="0,0,0,10"/>
5656
<TextBlock Text="{DynamicResource String_Protocol}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
57-
<ComboBox FontSize="14" ItemsSource="{Binding TransportTypes}" SelectedItem="{Binding TransportType}" Width="250" HorizontalAlignment="Left" Margin="0,0,0,10"/>
57+
<ComboBox ItemsSource="{Binding TransportTypes}" SelectedItem="{Binding TransportType}" Width="250" HorizontalAlignment="Left" Margin="0,0,0,10"/>
5858
<TextBlock Text="{DynamicResource String_Attempts}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
5959
<mah:NumericUpDown Value="{Binding Attempts}" Maximum="10" Minimum="1" Interval="1" Margin="0,0,0,10" />
6060
<TextBlock Text="{DynamicResource String_Timeout}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />

Source/NETworkManager/Views/Settings/SettingsApplicationRemoteDesktopView.xaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
88
mc:Ignorable="d">
99
<StackPanel>
10-
<TextBlock Text="{DynamicResource String_Header_RemoteDesktop}" Style="{StaticResource HeaderTextBlock}" />
11-
10+
<TextBlock Text="{DynamicResource String_Header_LocalDevicesAndResources}" Style="{StaticResource HeaderTextBlock}" />
11+
<mah:ToggleSwitch Header="Redirect clipboard" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectClipboard}" Margin="0,0,0,10"/>
12+
<mah:ToggleSwitch Header="Redirect devices" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectDevices}" Margin="0,0,0,10"/>
13+
<mah:ToggleSwitch Header="Redirect drives" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectDrives}" Margin="0,0,0,10"/>
14+
<mah:ToggleSwitch Header="Redirect ports" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectPorts}" Margin="0,0,0,10"/>
15+
<mah:ToggleSwitch Header="Redirect smartcards" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectSmartcards}" Margin="0,0,0,10"/>
16+
<mah:ToggleSwitch Header="Redirect printers" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectPrinters}" Margin="0,0,0,10"/>
1217
</StackPanel>
1318
</UserControl>

0 commit comments

Comments
 (0)