Skip to content

Commit

Permalink
added ShowConnectionInformation
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKoell committed Jan 16, 2024
1 parent 0034cd4 commit 97b81f1
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 2 deletions.
85 changes: 85 additions & 0 deletions src/RoyalApps.Community.Rdp.WinForms/Controls/RdpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,23 @@ public bool NegotiateSecurityLayer
set => LogFeatureNotSupported(nameof(NegotiateSecurityLayer));
}

/// <inheritdoc cref="ShowConnectionInformation"/>
public bool ShowConnectionInformation
{
get
{
if (!this.TryGetProperty<bool>(RdpClientExtensions.ShowConnectionInformation, out var value, out var ex))
Logger.LogWarning(ex, "Failed to get RDP client property: {PropertyName}", RdpClientExtensions.ShowConnectionInformation);
return value;
}
set
{
object showConnectionInformation = value;
if (!this.TrySetProperty(RdpClientExtensions.ShowConnectionInformation, ref showConnectionInformation, out var ex))
Logger.LogWarning(ex, "Failed to set RDP client property: {PropertyName} to {PropertyValue}", RdpClientExtensions.ShowConnectionInformation, showConnectionInformation);
}
}

#endregion

#region ::: Misc :::
Expand Down Expand Up @@ -1564,6 +1581,23 @@ public bool NegotiateSecurityLayer
}
}

/// <inheritdoc cref="ShowConnectionInformation"/>
public bool ShowConnectionInformation
{
get
{
if (!this.TryGetProperty<bool>(RdpClientExtensions.ShowConnectionInformation, out var value, out var ex))
Logger.LogWarning(ex, "Failed to get RDP client property: {PropertyName}", RdpClientExtensions.ShowConnectionInformation);
return value;
}
set
{
object showConnectionInformation = value;
if (!this.TrySetProperty(RdpClientExtensions.ShowConnectionInformation, ref showConnectionInformation, out var ex))
Logger.LogWarning(ex, "Failed to set RDP client property: {PropertyName} to {PropertyValue}", RdpClientExtensions.ShowConnectionInformation, showConnectionInformation);
}
}

#endregion

#region ::: Misc :::
Expand Down Expand Up @@ -2330,6 +2364,23 @@ public bool NegotiateSecurityLayer
}
}

/// <inheritdoc cref="ShowConnectionInformation"/>
public bool ShowConnectionInformation
{
get
{
if (!this.TryGetProperty<bool>(RdpClientExtensions.ShowConnectionInformation, out var value, out var ex))
Logger.LogWarning(ex, "Failed to get RDP client property: {PropertyName}", RdpClientExtensions.ShowConnectionInformation);
return value;
}
set
{
object showConnectionInformation = value;
if (!this.TrySetProperty(RdpClientExtensions.ShowConnectionInformation, ref showConnectionInformation, out var ex))
Logger.LogWarning(ex, "Failed to set RDP client property: {PropertyName} to {PropertyValue}", RdpClientExtensions.ShowConnectionInformation, showConnectionInformation);
}
}

#endregion

#region ::: Misc :::
Expand Down Expand Up @@ -3158,6 +3209,23 @@ public bool NegotiateSecurityLayer
}
}

/// <inheritdoc cref="ShowConnectionInformation"/>
public bool ShowConnectionInformation
{
get
{
if (!this.TryGetProperty<bool>(RdpClientExtensions.ShowConnectionInformation, out var value, out var ex))
Logger.LogWarning(ex, "Failed to get RDP client property: {PropertyName}", RdpClientExtensions.ShowConnectionInformation);
return value;
}
set
{
object showConnectionInformation = value;
if (!this.TrySetProperty(RdpClientExtensions.ShowConnectionInformation, ref showConnectionInformation, out var ex))
Logger.LogWarning(ex, "Failed to set RDP client property: {PropertyName} to {PropertyValue}", RdpClientExtensions.ShowConnectionInformation, showConnectionInformation);
}
}

#endregion

#region ::: Misc :::
Expand Down Expand Up @@ -3932,6 +4000,23 @@ public bool NegotiateSecurityLayer
}
}

/// <inheritdoc cref="ShowConnectionInformation"/>
public bool ShowConnectionInformation
{
get
{
if (!this.TryGetProperty<bool>(RdpClientExtensions.ShowConnectionInformation, out var value, out var ex))
Logger.LogWarning(ex, "Failed to get RDP client property: {PropertyName}", RdpClientExtensions.ShowConnectionInformation);
return value;
}
set
{
object showConnectionInformation = value;
if (!this.TrySetProperty(RdpClientExtensions.ShowConnectionInformation, ref showConnectionInformation, out var ex))
Logger.LogWarning(ex, "Failed to set RDP client property: {PropertyName} to {PropertyValue}", RdpClientExtensions.ShowConnectionInformation, showConnectionInformation);
}
}

#endregion

#region ::: Misc :::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ internal static class RdpClientExtensions
public static readonly string DisableCredentialsDelegation = "DisableCredentialsDelegation";
public static readonly string DisableUdpTransport = "DisableUDPTransport";
public static readonly string EnableMouseJiggler = "EnableMouseJiggler";
public static readonly string MouseJigglerInterval = "MouseJigglerInterval";
public static readonly string MouseJigglerMethod = "MouseJigglerMethod";
public static readonly string EnableRdsAadAuth = "EnableRdsAadAuth";
public static readonly string EnableHardwareMode = "EnableHardwareMode";
public static readonly string MouseJigglerInterval = "MouseJigglerInterval";
public static readonly string MouseJigglerMethod = "MouseJigglerMethod";
public static readonly string PasswordContainsSmartcardPin = "PasswordContainsSCardPin";
public static readonly string RestrictedLogon = "RestrictedLogon";
public static readonly string RedirectedAuthentication = "RedirectedAuthentication";
public static readonly string ShowConnectionInformation = "ShowConnectionInformation";

/// <summary>
/// Applies the RdpClientConfiguration to the RdpClient.
Expand Down
5 changes: 5 additions & 0 deletions src/RoyalApps.Community.Rdp.WinForms/Interfaces/IRdpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,11 @@ public interface IRdpClient : IDisposable

#region ::: Misc :::

/// <summary>
/// Shows the Connection Information dialog.
/// </summary>
bool ShowConnectionInformation { get; set; }

/// <summary>
/// ILogger instance. If not set, a default debug logger is used during debug mode.
/// </summary>
Expand Down

0 comments on commit 97b81f1

Please sign in to comment.