コード例 #1
0
        private void ReconnectForResize()
        {
            if (_rdpVersion < Versions.RDC80)
            {
                return;
            }

            if (!_loginComplete)
            {
                return;
            }

            if (!InterfaceControl.Info.AutomaticResize)
            {
                return;
            }

            if (!(InterfaceControl.Info.Resolution == RDPResolutions.FitToWindow | InterfaceControl.Info.Resolution == RDPResolutions.Fullscreen))
            {
                return;
            }

            if (SmartSize)
            {
                return;
            }

            var size = !Fullscreen ? Control.Size : Screen.FromControl(Control).Bounds.Size;

            IMsRdpClient8 msRdpClient8 = _rdpClient;

            msRdpClient8.Reconnect((uint)size.Width, (uint)size.Height);
        }
コード例 #2
0
ファイル: RdpProtocol.cs プロジェクト: GreyCorbel/mRemoteNG
        private void ReconnectForResize()
        {
            if (_rdpVersion < Versions.RDC80)
            {
                return;
            }

            if (!_loginComplete)
            {
                return;
            }

            if (!InterfaceControl.Info.AutomaticResize)
            {
                return;
            }

            if (!(InterfaceControl.Info.Resolution == RDPResolutions.FitToWindow | InterfaceControl.Info.Resolution == RDPResolutions.Fullscreen))
            {
                return;
            }

            if (SmartSize)
            {
                return;
            }

            try
            {
                Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Resizing RDP connection to host '{_connectionInfo.Hostname}'");
                var size = !Fullscreen ? Control.Size : Screen.FromControl(Control).Bounds.Size;

                IMsRdpClient8 msRdpClient8 = _rdpClient;
                msRdpClient8.Reconnect((uint)size.Width, (uint)size.Height);
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddExceptionMessage(string.Format(Language.ChangeConnectionResolutionError, _connectionInfo.Hostname),
                                                             ex, MessageClass.WarningMsg, false);
            }
        }