Example #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);
        }
Example #2
0
        private TabPage CreateExperiencePage()
        {
            TabPage tabPage  = NewTabPage("体验");
            int     rowIndex = 0;
            int     tabIndex = 0;

            _bandwidthComboBox = FormTools.AddLabeledValueDropDown(tabPage, "&S连接速度", ref rowIndex, ref tabIndex, (BandwidthItem v) => v.Text, _bandwidthItems);
            _bandwidthComboBox.SelectedIndexChanged += BandwidthCombo_ControlChanged;
            Label label = FormTools.NewLabel("允许以下:", 0, rowIndex);

            _desktopBackgroundCheckBox = FormTools.NewCheckBox("桌面背景", 1, rowIndex++, tabIndex++);
            _desktopBackgroundCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            _fontSmoothingCheckBox = FormTools.NewCheckBox("字体平滑", 1, rowIndex++, tabIndex++);
            _fontSmoothingCheckBox.CheckedChanged      += PerfCheckBox_CheckedChanged;
            _desktopCompositionCheckBox                 = FormTools.NewCheckBox("桌面布置", 1, rowIndex++, tabIndex++);
            _desktopCompositionCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            _windowDragCheckBox = FormTools.NewCheckBox("拖动时显示窗口内容", 1, rowIndex++, tabIndex++);
            _windowDragCheckBox.CheckedChanged    += PerfCheckBox_CheckedChanged;
            _menuAnimationCheckBox                 = FormTools.NewCheckBox("菜单和窗口动画", 1, rowIndex++, tabIndex++);
            _menuAnimationCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            _themesCheckBox = FormTools.NewCheckBox("主题", 1, rowIndex++, tabIndex++);
            _themesCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            tabPage.Controls.Add(label, _desktopBackgroundCheckBox, _fontSmoothingCheckBox, _desktopCompositionCheckBox, _windowDragCheckBox, _menuAnimationCheckBox, _themesCheckBox);
            return(tabPage);
        }
Example #3
0
        protected void Create(out int rowIndex, out int tabIndex)
        {
            tabIndex = 0;
            rowIndex = 0;
            CreateInheritanceControl(ref rowIndex, ref tabIndex);
            Label label = FormTools.NewLabel("ËõÂÔͼ±ÈÀý:", 0, rowIndex);

            label.Size = new Size(140, 20);
            RdcNumericUpDown rdcNumericUpDown = new RdcNumericUpDown();

            rdcNumericUpDown.Location = FormTools.NewLocation(1, rowIndex++);
            rdcNumericUpDown.Location = new Point(rdcNumericUpDown.Location.X, rdcNumericUpDown.Location.Y + 2);
            rdcNumericUpDown.Minimum  = 1m;
            rdcNumericUpDown.Maximum  = 9m;
            TSettingsGroup settings = base.Settings;

            rdcNumericUpDown.Setting  = settings.ThumbnailScale;
            rdcNumericUpDown.Size     = new Size(40, 20);
            rdcNumericUpDown.TabIndex = tabIndex++;
            RdcCheckBox    rdcCheckBox = FormTools.NewCheckBox("Ëõ·ÅÍ£¿¿µÄÔ¶³Ì×ÀÃæÒÔÊʺϴ°¿Ú", 0, rowIndex++, tabIndex++);
            TSettingsGroup settings2   = base.Settings;

            rdcCheckBox.Setting = settings2.SmartSizeDockedWindow;
            RdcCheckBox    rdcCheckBox2 = FormTools.NewCheckBox("Ëõ·Åδͣ¿¿µÄÔ¶³Ì×ÀÃæÒÔÊʺϴ°¿Ú", 0, rowIndex++, tabIndex++);
            TSettingsGroup settings3    = base.Settings;

            rdcCheckBox2.Setting = settings3.SmartSizeUndockedWindow;
            base.Controls.Add(label, rdcNumericUpDown, rdcCheckBox, rdcCheckBox2);
        }
Example #4
0
        private TabPage CreateFullScreenPage()
        {
            int     rowIndex = 0;
            int     tabIndex = 0;
            TabPage tabPage  = NewTabPage("全屏");

            _connectionBarEnabledCheckBox = FormTools.NewCheckBox("显示全屏工具栏", 0, rowIndex++, tabIndex++);
            _connectionBarEnabledCheckBox.CheckedChanged += ConnectionBarEnabledCheckedChanged;
            _connectionBarAutoHiddenCheckBox              = FormTools.NewCheckBox("自动隐藏工具栏", 0, rowIndex++, tabIndex++);
            _connectionBarAutoHiddenCheckBox.Location     = new Point(_connectionBarEnabledCheckBox.Left + 24, _connectionBarAutoHiddenCheckBox.Top);
            FormTools.AddCheckBox(tabPage, "全屏窗口始终位于顶部", Program.Preferences.Settings.FullScreenWindowIsTopMost, 0, ref rowIndex, ref tabIndex);
            if (RdpClient.SupportsMonitorSpanning)
            {
                FormTools.AddCheckBox(tabPage, "必要时使用多个显示器", Program.Preferences.Settings.UseMultipleMonitors, 0, ref rowIndex, ref tabIndex);
            }
            if (RdpClient.SupportsPanning)
            {
                _enablePanningCheckBox                 = FormTools.NewCheckBox("使用平移代替滚动条", 0, rowIndex++, tabIndex++);
                _enablePanningCheckBox.Setting         = Program.Preferences.Settings.EnablePanning;
                _enablePanningCheckBox.CheckedChanged += EnablePanningCheckedChanged;
                Label label = FormTools.NewLabel("平移速度", 0, rowIndex);
                label.Size                          = new Size(116, 20);
                label.Location                      = new Point(_enablePanningCheckBox.Left + 24, label.Top);
                _panningAccelerationUpDown          = new RdcNumericUpDown();
                _panningAccelerationUpDown.Location = FormTools.NewLocation(1, rowIndex++);
                _panningAccelerationUpDown.Minimum  = 1m;
                _panningAccelerationUpDown.Maximum  = 9m;
                _panningAccelerationUpDown.Size     = new Size(40, 20);
                _panningAccelerationUpDown.TabIndex = tabIndex++;
                _panningAccelerationUpDown.Setting  = Program.Preferences.Settings.PanningAcceleration;
                tabPage.Controls.Add(_enablePanningCheckBox, label, _panningAccelerationUpDown);
            }
            tabPage.Controls.Add(_connectionBarEnabledCheckBox, _connectionBarAutoHiddenCheckBox);
            return(tabPage);
        }
Example #5
0
        protected RdcTextBox AddComment(ref int rowIndex, ref int tabIndex)
        {
            Label      label      = FormTools.NewLabel("&Comment:", 0, rowIndex);
            RdcTextBox rdcTextBox = FormTools.NewTextBox(1, rowIndex++, tabIndex++, 7);

            rdcTextBox.Enabled = true;
            base.Controls.Add(label, rdcTextBox);
            return(rdcTextBox);
        }
Example #6
0
        protected RdcTextBox AddComment(ref int rowIndex, ref int tabIndex)
        {
            Label label = FormTools.NewLabel("备注:", 0, rowIndex);            //("&Comment:", 0, rowIndex)

            label.Size = new System.Drawing.Size(label.Size.Width - 100, label.Size.Height);
            RdcTextBox rdcTextBox = FormTools.NewTextBox(1, rowIndex++, tabIndex++, 10);

            rdcTextBox.Enabled  = true;
            rdcTextBox.Location = new System.Drawing.Point(rdcTextBox.Location.X - 100, rdcTextBox.Location.Y);
            rdcTextBox.Size     = new System.Drawing.Size(rdcTextBox.Size.Width + 100, rdcTextBox.Size.Height - 8);
            base.Controls.Add(label, rdcTextBox);
            return(rdcTextBox);
        }
Example #7
0
        private void AddHotKeyBox(Control parent, string label, string prefix, EnumSetting <Keys> setting, ref int rowIndex, ref int tabIndex)
        {
            parent.Controls.Add(FormTools.NewLabel(label, 0, rowIndex));
            HotKeyBox hotKeyBox = new HotKeyBox();

            hotKeyBox.Prefix   = prefix;
            hotKeyBox.Location = FormTools.NewLocation(1, rowIndex++);
            hotKeyBox.Size     = new Size(340, 20);
            hotKeyBox.TabIndex = tabIndex++;
            hotKeyBox.Setting  = setting;
            HotKeyBox value = hotKeyBox;

            parent.Controls.Add(value);
        }
Example #8
0
                public RecentlyUsedSettingsTabPage(TabbedSettingsDialog dialog, RecentlyUsedSettings settings)
                    : base(dialog, settings)
                {
                    int            rowIndex       = 0;
                    int            num            = 0;
                    Label          label          = FormTools.NewLabel("显示数量", 0, rowIndex);
                    NumericTextBox numericTextBox = new NumericTextBox(1, 20, "数量应该在 1 到 20 之间")
                    {
                        Location = FormTools.NewLocation(1, rowIndex++),
                        TabIndex = num++,
                        TabStop  = true,
                        Setting  = base.Settings.MaxNumberOfServers,
                        Size     = new Size(20, 20)
                    };

                    base.Controls.Add(label, numericTextBox);
                    base.FocusControl = numericTextBox;
                }
Example #9
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);
        }
        protected int CreateProfileManagementTabPage()
        {
            int     result  = 0;
            TabPage tabPage = FormTools.NewTabPage("配置管理");
            Label   label   = FormTools.NewLabel("配置", 0, result++);

            _credentialsListBox = new ListBox
            {
                Location = FormTools.NewLocation(0, result++),
                Size     = new Size(340, 200)
            };
            _credentialsListBox.KeyDown        += CredentialsListBox_KeyDown;
            _credentialsListBox.DoubleClick    += EditButton_Click;
            _credentialsListBox.VisibleChanged += CredentialsListBox_VisibleChanged;
            Button button = new Button();

            button.Text     = "添加";
            button.Location = new Point(_credentialsListBox.Right + 20, _credentialsListBox.Top);
            Button button2 = button;

            button2.Click += AddButton_Click;
            Button button3 = new Button();

            button3.Text     = "编辑";
            button3.Location = new Point(_credentialsListBox.Right + 20, button2.Bottom + 4);
            Button button4 = button3;

            button4.Click += EditButton_Click;
            Button button5 = new Button();

            button5.Text     = "删除";
            button5.Location = new Point(_credentialsListBox.Right + 20, button4.Bottom + 4);
            Button button6 = button5;

            button6.Click += DeleteButton_Click;
            tabPage.Controls.Add(label, _credentialsListBox, button2, button4, button6);
            tabPage.ResumeLayout();
            AddTabPage(tabPage);
            return(result);
        }
        public ConnectionSettingsTabPage(TabbedSettingsDialog dialog, ConnectionSettings settings)
            : base(dialog, settings)
        {
            int tabIndex = 0;
            int rowIndex = 0;

            CreateInheritanceControl(ref rowIndex, ref tabIndex);
            FormTools.AddCheckBox(this, "连接到控制台", settings.ConnectToConsole, 1, ref rowIndex, ref tabIndex);
            FormTools.AddLabeledTextBox(this, "启动程序:", settings.StartProgram, ref rowIndex, ref tabIndex);
            FormTools.AddLabeledTextBox(this, "工作目录:", settings.WorkingDir, ref rowIndex, ref tabIndex);
            Label label = FormTools.NewLabel("端口:", 0, rowIndex);

            _portUpDown = new NumericUpDown();
            ((ISupportInitialize)_portUpDown).BeginInit();
            _portUpDown.Location = FormTools.NewLocation(1, rowIndex++);
            _portUpDown.Size     = new Size(160, 20);
            _portUpDown.Minimum  = 1m;
            _portUpDown.Maximum  = 65535m;
            NumericUpDown   portUpDown = _portUpDown;
            KeyEventHandler value      = delegate
            {
                UpdatePortDefaultLabel();
            };

            portUpDown.KeyUp         += value;
            _portUpDown.ValueChanged += delegate
            {
                UpdatePortDefaultLabel();
            };
            _portUpDown.TabIndex = tabIndex++;
            ((ISupportInitialize)_portUpDown).EndInit();
            _portDefaultLabel           = new Label();
            _portDefaultLabel.Location  = new Point(_portUpDown.Location.X + _portUpDown.Width, _portUpDown.Location.Y - 1);
            _portDefaultLabel.Size      = new Size(140, 20);
            _portDefaultLabel.TextAlign = ContentAlignment.MiddleLeft;
            FormTools.AddLabeledTextBox(this, "加载负载平衡配置:", settings.LoadBalanceInfo, ref rowIndex, ref tabIndex);
            base.Controls.Add(label, _portUpDown, _portDefaultLabel);
        }
Example #12
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);
        }