Example #1
0
        public override void FillControls(FavoriteConfigurationElement favorite)
        {
            this.RedirectedDrives = favorite.RedirectedDrives;
            this.chkSerialPorts.Checked = favorite.RedirectPorts;
            this.chkPrinters.Checked = favorite.RedirectPrinters;
            this.chkRedirectClipboard.Checked = favorite.RedirectClipboard;
            this.RedirectDevices = favorite.RedirectDevices;
            this.chkRedirectSmartcards.Checked = favorite.RedirectSmartCards;
            this.cmbSounds.SelectedIndex = (Int32)favorite.Sounds;

            this.txtDesktopShare.Text = favorite.DesktopShare;

            this.widthUpDown.Value = favorite.DesktopSizeWidth;
            this.heightUpDown.Value = favorite.DesktopSizeHeight;

            switch (favorite.TsgwUsageMethod)
            {
                case 0:
                    this.radTSGWdisable.Checked = true;
                    this.chkTSGWlocalBypass.Checked = false;
                    break;
                case 1:
                    this.radTSGWenable.Checked = true;
                    this.chkTSGWlocalBypass.Checked = false;
                    break;
                case 2:
                    this.radTSGWenable.Checked = true;
                    this.chkTSGWlocalBypass.Checked = true;
                    break;
                case 4:
                    this.radTSGWdisable.Checked = true;
                    this.chkTSGWlocalBypass.Checked = true;
                    break;
            }

            this.txtTSGWServer.Text = favorite.TsgwHostname;

            // A seperate login hasn't been specified - so clear the TSGW credentials
            if (!favorite.TsgwSeparateLogin)
                favorite.TsgwDomain = favorite.TsgwUsername = favorite.TsgwPassword = favorite.TsgwXmlCredentialSetName = string.Empty;

            // Use the tswg credentials
            else
            {
                if (favorite.TsgwXmlCredentialSetName == Terminals.Forms.Controls.CredentialPanel.Custom)
                {
                    this.pnlTSGWlogon.FillControls(new FavoriteConfigurationElement() { DomainName = favorite.TsgwDomain, UserName = favorite.TsgwUsername, Password = favorite.TsgwPassword  });
                }
                this.pnlTSGWlogon.FillCredentials(favorite.TsgwXmlCredentialSetName);

                // if the credential store isn't either set/filled or set to the storename "custom" than check if
                // the values contain garbage -> if so clear the store and set seperate login to false.
                if (string.IsNullOrEmpty(favorite.TsgwXmlCredentialSetName) || favorite.TsgwXmlCredentialSetName == Terminals.Forms.Controls.CredentialPanel.Custom)
                    // if there are no credentials in the store and no custom ones -> clear the the TSGW credentials and disable the checkbox
                    if (string.IsNullOrEmpty(favorite.TsgwDomain) && string.IsNullOrEmpty(favorite.TsgwUsername) && string.IsNullOrEmpty(favorite.TsgwPassword))
                    {
                        favorite.TsgwXmlCredentialSetName = string.Empty;
                        favorite.TsgwSeparateLogin = false;
                    }
            }

            if (terminalServerManager == null)
            {
                this.terminalServerManager = new TerminalServerManager()
                {
                    SaveInDB = ((FavoriteEditor)this.ParentForm).SaveInDB,
                    Dock = DockStyle.Fill,
                    Location = new Point(0, 0),
                    Name = "terminalServerManager1",
                    Size = new Size(748, 309),
                    TabIndex = 0
                };

                this.tabPage10.Controls.Add(this.terminalServerManager);
            }

            this.chkTSGWlogin.Checked = favorite.TsgwSeparateLogin;
            this.cmbTSGWLogonMethod.SelectedIndex = favorite.TsgwCredsSource;

            this.cmbResolution.SelectedIndex = (Int32)favorite.DesktopSize;
            this.cmbColors.SelectedIndex = (Int32)favorite.Colors;
            this.chkConnectToConsole.Checked = favorite.ConnectToConsole;

            //extended settings
            this.ShutdownTimeoutTextBox.Text = favorite.ShutdownTimeout.ToString();
            this.OverallTimeoutTextbox.Text = favorite.OverallTimeout.ToString();
            this.SingleTimeOutTextbox.Text = favorite.ConnectionTimeout.ToString();
            this.IdleTimeoutMinutesTextBox.Text = favorite.IdleTimeout.ToString();
            this.SecurityWorkingFolderTextBox.Text = favorite.SecurityWorkingFolder;
            this.SecuriytStartProgramTextbox.Text = favorite.SecurityStartProgram;
            this.SecurityStartFullScreenCheckbox.Checked = favorite.SecurityFullScreen;
            this.SecuritySettingsEnabledCheckbox.Checked = favorite.EnableSecuritySettings;
            this.GrabFocusOnConnectCheckbox.Checked = favorite.GrabFocusOnConnect;
            this.EnableEncryptionCheckbox.Checked = favorite.EnableEncryption;
            this.DisableWindowsKeyCheckbox.Checked = favorite.DisableWindowsKey;
            this.DetectDoubleClicksCheckbox.Checked = favorite.DoubleClickDetect;
            this.DisplayConnectionBarCheckbox.Checked = favorite.DisplayConnectionBar;
            this.DisableControlAltDeleteCheckbox.Checked = favorite.DisableControlAltDelete;
            this.AcceleratorPassthroughCheckBox.Checked = favorite.AcceleratorPassthrough;
            this.EnableCompressionCheckbox.Checked = favorite.EnableCompression;
            this.EnableBitmapPersistanceCheckbox.Checked = favorite.BitmapPeristence;
            this.EnableTLSAuthenticationCheckbox.Checked = favorite.EnableTlsAuthentication;
            this.EnableNLAAuthenticationCheckbox.Checked = favorite.EnableNlaAuthentication;
            this.AllowBackgroundInputCheckBox.Checked = favorite.AllowBackgroundInput;

            this.chkDisableCursorShadow.Checked = false;
            this.chkDisableCursorBlinking.Checked = false;
            this.chkDisableFullWindowDrag.Checked = false;
            this.chkDisableMenuAnimations.Checked = false;
            this.chkDisableThemes.Checked = false;
            this.chkDisableWallpaper.Checked = false;

            if (favorite.PerformanceFlags > 0)
            {
                this.chkDisableCursorShadow.Checked = favorite.DisableCursorShadow;
                this.chkDisableCursorBlinking.Checked = favorite.DisableCursorBlinking;
                this.chkDisableFullWindowDrag.Checked = favorite.DisableFullWindowDrag;
                this.chkDisableMenuAnimations.Checked = favorite.DisableMenuAnimations;
                this.chkDisableThemes.Checked = favorite.DisableTheming;
                this.chkDisableWallpaper.Checked = favorite.DisableWallPaper;
                this.AllowFontSmoothingCheckbox.Checked = favorite.EnableFontSmoothing;
                this.AllowDesktopCompositionCheckbox.Checked = favorite.EnableDesktopComposition;
            }
        }
Example #2
0
        private void RDPSubTabPage_SelectedIndexChanged(object sender, EventArgs e)
        {
            string name = ((FavoriteEditor)this.ParentForm).Server;

            if (string.IsNullOrEmpty(name))
                return;

            if (this.RDPSubTabPage.SelectedTab == this.tabPage10)
            {
                if (terminalServerManager == null)
                {
                    this.terminalServerManager = new TerminalServerManager()
                    {
                        SaveInDB = ((FavoriteEditor)this.ParentForm).SaveInDB,
                        Dock = DockStyle.Fill,
                        Location = new Point(0, 0),
                        Name = "terminalServerManager1",
                        Size = new Size(748, 309),
                        TabIndex = 0
                    };

                    this.tabPage10.Controls.Add(this.terminalServerManager);
                }

                this.terminalServerManager.Connect(name, true);
                this.terminalServerManager.Invalidate();
            }
        }