88using System . Windows . Threading ;
99using NETworkManager . Utilities ;
1010using NETworkManager . Models . Settings ;
11+ using System . Diagnostics ;
1112
1213namespace NETworkManager . Controls
1314{
@@ -27,7 +28,7 @@ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName
2728
2829 private const string RemoteDesktopDisconnectReasonIdentifier = "String_RemoteDesktopDisconnectReason_" ;
2930
30- private Models . RemoteDesktop . RemoteDesktopSessionInfo _rdpProfileInfo ;
31+ private RemoteDesktopSessionInfo _rdpProfileInfo ;
3132
3233 DispatcherTimer reconnectAdjustScreenTimer = new DispatcherTimer ( ) ;
3334
@@ -75,6 +76,20 @@ public bool Connected
7576 }
7677 }
7778
79+ private bool _reconnecting ;
80+ public bool Reconnecting
81+ {
82+ get { return _reconnecting ; }
83+ set
84+ {
85+ if ( value == _reconnecting )
86+ return ;
87+
88+ _reconnecting = value ;
89+ OnPropertyChanged ( ) ;
90+ }
91+ }
92+
7893 private string _disconnectReason ;
7994 public string DisconnectReason
8095 {
@@ -91,7 +106,7 @@ public string DisconnectReason
91106 #endregion
92107
93108 #region Constructor, load
94- public RemoteDesktopControl ( Models . RemoteDesktop . RemoteDesktopSessionInfo info )
109+ public RemoteDesktopControl ( RemoteDesktopSessionInfo info )
95110 {
96111 InitializeComponent ( ) ;
97112 DataContext = this ;
@@ -181,6 +196,8 @@ private void Connect()
181196
182197 private void Reconnect ( )
183198 {
199+ Reconnecting = true ;
200+
184201 if ( _rdpProfileInfo . AdjustScreenAutomatically )
185202 {
186203 rdpClient . DesktopWidth = ( int ) rdpGrid . ActualWidth ;
@@ -341,6 +358,7 @@ private void RdpClient_OnConnected(object sender, EventArgs e)
341358 private void RdpClient_OnDisconnected ( object sender , AxMSTSCLib . IMsTscAxEvents_OnDisconnectedEvent e )
342359 {
343360 Connected = false ;
361+ Reconnecting = false ;
344362
345363 DisconnectReason = GetDisconnectReason ( e . discReason ) ;
346364 }
0 commit comments