示例#1
0
        public EncryptionSettingsTabPage(TabbedSettingsDialog dialog, EncryptionSettings settings)
            : base(dialog, settings)
        {
            int tabIndex = 0;
            int rowIndex = 0;

            CreateInheritanceControl(ref rowIndex, ref tabIndex);
            if (base.InheritanceControl != null)
            {
                base.InheritanceControl.EnabledChanged += delegate
                {
                    PasswordEncryptionMethodCombo_Changed(null, null);
                };
            }
            _passwordEncryptionMethodCombo        = FormTools.AddLabeledEnumDropDown(this, "加密密码:", base.Settings.EncryptionMethod, ref rowIndex, ref tabIndex, Encryption.EncryptionMethodToString);
            _passwordEncryptionMethodCombo.Enter += PasswordEncryptionMethodCombo_Enter;
            _passwordEncryptionMethodCombo.SelectedIndexChanged += PasswordEncryptionMethodCombo_Changed;
            _passwordEncryptionDataLabel  = FormTools.NewLabel(string.Empty, 0, rowIndex);
            _passwordEncryptionDataButton = new Button
            {
                Enabled   = false,
                Location  = FormTools.NewLocation(1, rowIndex++),
                Width     = 340,
                TabIndex  = tabIndex++,
                TextAlign = ContentAlignment.MiddleLeft
            };
            _passwordEncryptionDataButton.Click   += PasswordEncryptionMethodButton_Click;
            _passwordEncryptionDataInfoLabel       = FormTools.NewLabel(string.Empty, 1, rowIndex++);
            _passwordEncryptionDataInfoLabel.Width = 340;
            base.Controls.Add(_passwordEncryptionDataLabel, _passwordEncryptionDataButton, _passwordEncryptionDataInfoLabel);
        }
示例#2
0
        public LocalResourcesTabPage(TabbedSettingsDialog dialog, LocalResourcesSettings settings)
            : base(dialog, settings)
        {
            int tabIndex = 0;
            int rowIndex = 0;

            CreateInheritanceControl(ref rowIndex, ref tabIndex);
            FormTools.AddLabeledEnumDropDown(this, "Remote &sound", base.Settings.AudioRedirectionMode, ref rowIndex, ref tabIndex, RdpClient.AudioRedirectionModeToString);
            if (RdpClient.SupportsAdvancedAudioVideoRedirection)
            {
                FormTools.AddLabeledEnumDropDown(this, "Sound &quality", base.Settings.AudioRedirectionQuality, ref rowIndex, ref tabIndex, RdpClient.AudioRedirectionQualityToString);
                FormTools.AddLabeledEnumDropDown(this, "Remote &recording", base.Settings.AudioCaptureRedirectionMode, ref rowIndex, ref tabIndex, RdpClient.AudioCaptureRedirectionModeToString);
            }
            FormTools.AddLabeledEnumDropDown(this, "&Windows key combos", base.Settings.KeyboardHookMode, ref rowIndex, ref tabIndex, RdpClient.KeyboardHookModeToString);
            Label    value    = FormTools.NewLabel("Redirect options", 0, rowIndex);
            TreeView treeView = new TreeView
            {
                Location   = FormTools.NewLocation(1, rowIndex),
                Size       = new Size(340, 140),
                CheckBoxes = true,
                Scrollable = true,
                ShowLines  = false
            };

            treeView.AfterCheck        += RedirectView_AfterCheck;
            _redirectClipboardCheckBox  = treeView.Nodes.Add("Clipboard");
            _redirectPrintersCheckBox   = treeView.Nodes.Add("Printers");
            _redirectSmartCardsCheckBox = treeView.Nodes.Add("Smart cards");
            _redirectPortsCheckBox      = treeView.Nodes.Add("Ports");
            _redirectDrivesCheckBox     = treeView.Nodes.Add("Drives");
            _redirectPnpDevicesCheckBox = treeView.Nodes.Add("PnP devices");
            if (RdpClient.SupportsFineGrainedRedirection)
            {
                IMsRdpDriveCollection driveCollection = RdpClient.DriveCollection;
                for (uint num = 0u; num < driveCollection.DriveCount; num++)
                {
                    IMsRdpDrive msRdpDrive = driveCollection.get_DriveByIndex(num);
                    _redirectDrivesCheckBox.Nodes.Add(msRdpDrive.Name.Substring(0, msRdpDrive.Name.Length - 1));
                }
            }
            base.Controls.Add(value);
            base.Controls.Add(treeView);
        }
示例#3
0
        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);
            }
        }
示例#4
0
        private TabPage CreateServerTreePage()
        {
            int      rowIndex = 0;
            int      tabIndex = 0;
            TabPage  tabPage  = NewTabPage("群组树");
            GroupBox groupBox = new GroupBox();

            groupBox.Text = "服务器树";
            GroupBox groupBox2 = groupBox;

            FormTools.AddCheckBox(groupBox2, "单击以选中将焦点移到远程客户端", Program.Preferences.Settings.FocusOnClick, 0, ref rowIndex, ref tabIndex);
            FormTools.AddCheckBox(groupBox2, "树控件处于非活动状态时使节点变暗", Program.Preferences.Settings.DimNodesWhenInactive, 0, ref rowIndex, ref tabIndex);
            _treeLocationCombo = FormTools.AddLabeledValueDropDown(groupBox2, "位置", ref rowIndex, ref tabIndex, (DockStyle v) => v.ToString(), new DockStyle[2]
            {
                DockStyle.Left,
                DockStyle.Right
            });
            _treeVisibilityCombo = FormTools.AddLabeledValueDropDown(groupBox2, "可见方式", ref rowIndex, ref tabIndex, (ControlVisibility v) => v.ToString(), new ControlVisibility[3]
            {
                ControlVisibility.Dock,
                ControlVisibility.AutoHide,
                ControlVisibility.Hide
            });
            Label label = FormTools.NewLabel("弹出延迟:", 0, rowIndex++);

            label.Left += 24;
            label.Size  = new Size(80, label.Height);
            NumericTextBox serverTreeAutoHidePopUpDelay = new NumericTextBox(0, 1000, "自动隐藏弹出延迟时间必须为0到1000毫秒")
            {
                Enabled  = false,
                Location = new Point(label.Right, label.Top),
                Size     = new Size(40, 24),
                Setting  = Program.Preferences.Settings.ServerTreeAutoHidePopUpDelay,
                TabStop  = true,
                TabIndex = tabIndex++
            };

            _treeVisibilityCombo.SelectedIndexChanged += delegate
            {
                serverTreeAutoHidePopUpDelay.Enabled = (_treeVisibilityCombo.SelectedValue == ControlVisibility.AutoHide);
            };
            groupBox2.AddControlsAndSizeGroup(label);
            Label label2 = new Label();

            label2.Location = new Point(serverTreeAutoHidePopUpDelay.Right + 3, label.Top);
            label2.Size     = new Size(80, 24);
            label2.Text     = "毫秒(s)";
            Label label3 = label2;

            groupBox2.Controls.Add(serverTreeAutoHidePopUpDelay, label3);
            groupBox2.SizeAndLocate(null);
            _virtualGroupsGroup = new GroupBox
            {
                Text = "虚拟群组"
            };
            foreach (IBuiltInVirtualGroup item in Program.BuiltInVirtualGroups.Where((IBuiltInVirtualGroup group) => group.IsVisibilityConfigurable))
            {
                _virtualGroupsGroup.Controls.Add(new CheckBox
                {
                    Size = new Size(112, 24),
                    Tag  = item,
                    Text = item.Text
                });
            }
            FormTools.LayoutGroupBox(_virtualGroupsGroup, 2, groupBox2);
            rowIndex = 0;
            tabIndex = 0;
            GroupBox groupBox3 = new GroupBox();

            FormTools.AddLabeledValueDropDown(groupBox3, "组排序方式", Program.Preferences.Settings.GroupSortOrder, ref rowIndex, ref tabIndex, Helpers.SortOrderToString, new SortOrder[2]
            {
                SortOrder.ByName,
                SortOrder.None
            });
            FormTools.AddLabeledEnumDropDown(groupBox3, "服务器排序方式", Program.Preferences.Settings.ServerSortOrder, ref rowIndex, ref tabIndex, Helpers.SortOrderToString);
            groupBox3.Text = "排序方式";
            FormTools.LayoutGroupBox(groupBox3, 2, _virtualGroupsGroup);
            tabPage.Controls.Add(groupBox2, groupBox3, _virtualGroupsGroup);
            return(tabPage);
        }