mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
Merge pull request #2534 from jcefoli/v1.77.3-dev
Handle case where COM object becomes separated from RCW
This commit is contained in:
@@ -51,8 +51,32 @@ namespace mRemoteNG.Connection.Protocol.RDP
|
||||
|
||||
public virtual bool SmartSize
|
||||
{
|
||||
get => _rdpClient.AdvancedSettings2.SmartSizing;
|
||||
protected set => _rdpClient.AdvancedSettings2.SmartSizing = value;
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return _rdpClient.AdvancedSettings2.SmartSizing;
|
||||
}
|
||||
catch (System.Runtime.InteropServices.InvalidComObjectException)
|
||||
{
|
||||
// The COM object is separated from its RCW, try reacquiring the RCW or recreating the COM object
|
||||
_rdpClient = new MsRdpClient6NotSafeForScripting();
|
||||
return _rdpClient.AdvancedSettings2.SmartSizing;
|
||||
}
|
||||
}
|
||||
protected set
|
||||
{
|
||||
try
|
||||
{
|
||||
_rdpClient.AdvancedSettings2.SmartSizing = value;
|
||||
}
|
||||
catch (System.Runtime.InteropServices.InvalidComObjectException)
|
||||
{
|
||||
// The COM object is separated from its RCW, try reacquiring the RCW or recreating the COM object
|
||||
_rdpClient = new MsRdpClient6NotSafeForScripting();
|
||||
_rdpClient.AdvancedSettings2.SmartSizing = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Fullscreen
|
||||
|
||||
Reference in New Issue
Block a user