public virtual void CreateControls(RdcTreeNode settings) { LogonCredentialsTabPage logonCredentialsTabPage = (LogonCredentialsTabPage)settings.LogonCredentials.CreateTabPage(this); LogonCredentialsDialogOptions logonCredentialsDialogOptions = LogonCredentialsDialogOptions.ShowProfiles; if (settings.LogonCredentials.InheritSettingsType.Mode != InheritanceMode.Disabled) { logonCredentialsDialogOptions |= LogonCredentialsDialogOptions.AllowInheritance; } logonCredentialsTabPage.CreateControls(logonCredentialsDialogOptions); AddTabPage(logonCredentialsTabPage); GatewaySettingsTabPage gatewaySettingsTabPage = (GatewaySettingsTabPage)settings.GatewaySettings.CreateTabPage(this); logonCredentialsDialogOptions = LogonCredentialsDialogOptions.ShowProfiles; if (settings.GatewaySettings.InheritSettingsType.Mode != InheritanceMode.Disabled) { logonCredentialsDialogOptions |= LogonCredentialsDialogOptions.AllowInheritance; } gatewaySettingsTabPage.CreateControls(logonCredentialsDialogOptions); AddTabPage(gatewaySettingsTabPage); AddTabPage(settings.ConnectionSettings.CreateTabPage(this)); AddTabPage(settings.RemoteDesktopSettings.CreateTabPage(this)); AddTabPage(settings.LocalResourceSettings.CreateTabPage(this)); AddTabPage(settings.SecuritySettings.CreateTabPage(this)); AddTabPage(settings.DisplaySettings.CreateTabPage(this)); InitButtons(); this.ScaleAndLayout(); settings.InheritSettings(); settings.ResolveCredentials(); }
public void CreateControls(LogonCredentialsDialogOptions options) { int tabIndex = 0; int rowIndex = 0; if ((options & LogonCredentialsDialogOptions.AllowInheritance) != 0) { CreateInheritanceControl(ref rowIndex, ref tabIndex); base.InheritanceControl.EnabledChanged += delegate(bool enabled) { _credentialsUI.EnableDisableControls(enabled); }; } _credentialsUI = new CredentialsUI(base.InheritanceControl); _credentialsUI.AddControlsToParent(this, options, ref rowIndex, ref tabIndex); }
public void CreateControls(LogonCredentialsDialogOptions options) { int tabIndex = 0; int rowIndex = 0; CreateInheritanceControl(ref rowIndex, ref tabIndex); if (base.InheritanceControl != null) { base.InheritanceControl.EnabledChanged += delegate(bool enabled) { _useGatewayServerCheckBox.Enabled = enabled; UseGatewayServerCheckBox_CheckedChanged(null, null); }; } _useGatewayServerCheckBox = FormTools.AddCheckBox(this, "使用TS网关服务器", base.Settings.UseGatewayServer, 1, ref rowIndex, ref tabIndex); _useGatewayServerCheckBox.CheckedChanged += UseGatewayServerCheckBox_CheckedChanged; _gatewayHostNameTextBox = FormTools.AddLabeledTextBox(this, "服务器名称:", base.Settings.HostName, ref rowIndex, ref tabIndex); _gatewayHostNameTextBox.Validate = delegate { if (_gatewayHostNameTextBox.Enabled) { _gatewayHostNameTextBox.Text = _gatewayHostNameTextBox.Text.Trim(); string text = _gatewayHostNameTextBox.Text; if (text.Length == 0) { return("请输入服务器名称"); } } return(null); }; _gatewayLocalBypassCheckBox = FormTools.AddCheckBox(this, "绕过本地地址", base.Settings.BypassGatewayForLocalAddresses, 1, ref rowIndex, ref tabIndex); _gatewayLogonMethodCombo = FormTools.AddLabeledEnumDropDown(this, "登录方式", base.Settings.LogonMethod, ref rowIndex, ref tabIndex, RdpClient.GatewayLogonMethodToString); _gatewayLogonMethodCombo.SelectedValueChanged += GatewayLogonMethodComboBox_SelectedValueChanged; if (RdpClient.SupportsGatewayCredentials) { _gatewayCredSharingCheckBox = FormTools.AddCheckBox(this, "与远程计算机共享网关证书", base.Settings.CredentialSharing, 1, ref rowIndex, ref tabIndex); _gatewayCredSharingCheckBox.CheckedChanged += GatewayCredSharingCheckBox_CheckedChanged; _credentialsUI = new CredentialsUI(base.InheritanceControl); _credentialsUI.AddControlsToParent(this, options, ref rowIndex, ref tabIndex); } }
public void AddControlsToParent(Control parent, LogonCredentialsDialogOptions options, ref int rowIndex, ref int tabIndex) { if ((options & LogonCredentialsDialogOptions.ShowProfiles) != 0) { ProfileComboBox = FormTools.AddLabeledValueDropDown <CredentialsProfile>(parent, "配置:", ref rowIndex, ref tabIndex, null, null); ProfileComboBox.SelectedIndexChanged += OnProfileChanged; ProfileComboBox.VisibleChanged += OnProfileVisible; _saveProfileButton = new Button { TabIndex = tabIndex++, Text = "保存" }; _saveProfileButton.Location = new Point(ProfileComboBox.Right - _saveProfileButton.Width, ProfileComboBox.Location.Y - 1); _saveProfileButton.Click += SaveProfileButton_Click; parent.Controls.Add(_saveProfileButton); ProfileComboBox.Width -= _saveProfileButton.Width; } UserNameTextBox = FormTools.AddLabeledTextBox(parent, "用户名:", ref rowIndex, ref tabIndex); UserNameTextBox.TextChanged += OnUserNameChanged; PasswordTextBox = FormTools.AddLabeledTextBox(parent, "密码:", ref rowIndex, ref tabIndex); PasswordTextBox.PasswordChar = '●'; PasswordTextBox.TextChanged += OnPasswordChanged; DomainTextBox = FormTools.AddLabeledTextBox(parent, "域:", ref rowIndex, ref tabIndex); }