Exemple #1
0
        public override void ChangeDesktopSize(DesktopSize desktopSize)
        {
            Size size = DesktopSizeCalculator.GetSize(this, this.Favorite);

            try
            {
                switch (desktopSize)
                {
                case DesktopSize.AutoScale:
                case DesktopSize.FitToWindow:
                    this.client.AdvancedSettings3.SmartSizing = true;
                    break;

                case DesktopSize.FullScreen:
                    this.client.FullScreen = true;
                    break;
                }

                this.client.DesktopWidth  = size.Width;
                this.client.DesktopHeight = size.Height;
            }
            catch (Exception exc)
            {
                Logging.Error("Error trying to set the desktop dimensions", exc);
            }
        }
Exemple #2
0
        public override bool Connect()
        {
            try
            {
                vmrc = new AxVMRCClientControl();
                Controls.Add(vmrc);
                vmrc.BringToFront();
                this.BringToFront();
                vmrc.Parent = this.Parent;

                vmrc.ServerAddress = Favorite.ServerName;
                vmrc.ServerPort    = Favorite.Port;
                IGuardedSecurity resolved = this.ResolveFavoriteCredentials();
                vmrc.UserName     = resolved.UserName;
                vmrc.UserDomain   = resolved.Domain;
                vmrc.UserPassword = resolved.Password;

                var options = this.Favorite.ProtocolProperties as VMRCOptions;
                vmrc.AdministratorMode = options.AdministratorMode;
                vmrc.ReducedColorsMode = options.ReducedColorsMode;

                Size size = DesktopSizeCalculator.GetSize(this, Favorite);
                //vmrc.ServerDisplayHeight = size.Height;
                //vmrc.ServerDisplayWidth = size.Width;

                vmrc.OnStateChanged    += new _IVMRCClientControlEvents_OnStateChangedEventHandler(vmrc_OnStateChanged);
                vmrc.OnSwitchedDisplay += new _IVMRCClientControlEvents_OnSwitchedDisplayEventHandler(vmrc_OnSwitchedDisplay);

                Text = "Connecting to VMRC Server...";
                vmrc.Connect();
                //vmrc.BringToFront();
                //vmrc.Update();
                return(true);
            }
            catch (Exception exc)
            {
                Logging.Fatal("Connecting to VMRC", exc);
                return(false);
            }
        }