mRemoteNG.Connection.Protocol.ICA.ProtocolICA.SetResolution C# (CSharp) Method

SetResolution() private method

private SetResolution ( ) : void
return void
        private void SetResolution()
        {
            try
            {
                if ((Force & ConnectionInfo.Force.Fullscreen) == ConnectionInfo.Force.Fullscreen)
                {
                    _ICAClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, Screen.FromControl(frmMain.Default).Bounds.Width, Screen.FromControl(frmMain.Default).Bounds.Height, 0);
                    _ICAClient.FullScreenWindow();

                    return;
                }

                if (InterfaceControl.Info.Resolution == ProtocolRDP.RDPResolutions.FitToWindow)
                {
                    _ICAClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, InterfaceControl.Size.Width, InterfaceControl.Size.Height, 0);
                }
                else if (InterfaceControl.Info.Resolution == ProtocolRDP.RDPResolutions.SmartSize)
                {
                    _ICAClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, InterfaceControl.Size.Width, InterfaceControl.Size.Height, 0);
                }
                else if (InterfaceControl.Info.Resolution == ProtocolRDP.RDPResolutions.Fullscreen)
                {
                    _ICAClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, Screen.FromControl(frmMain.Default).Bounds.Width, Screen.FromControl(frmMain.Default).Bounds.Height, 0);
                    _ICAClient.FullScreenWindow();
                }
                else
                {
                    Rectangle resolution = ProtocolRDP.GetResolutionRectangle(_Info.Resolution);
                    _ICAClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, resolution.Width, resolution.Height, 0);
                }
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strIcaSetResolutionFailed + Environment.NewLine + ex.Message, true);
            }
        }