예제 #1
0
 public InheritanceControl(TabbedSettingsDialog dialog, string settingsGroupName)
 {
     _dialog            = dialog;
     _settingsGroupName = settingsGroupName;
     _sourceNode        = DefaultSettingsGroup.Instance;
     _enabled           = true;
 }
예제 #2
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);
        }
예제 #3
0
        public FileGroupPropertiesTabPage(TabbedSettingsDialog dialog, FileGroupSettings settings)
            : base(dialog, settings, settings.Name)
        {
            int rowIndex = 0;
            int tabIndex = 0;

            AddGroupName(ref rowIndex, ref tabIndex);
            _pathnameTextBox = FormTools.AddLabeledTextBox(this, "·¾¶:", ref rowIndex, ref tabIndex);
            AddComment(ref rowIndex, ref tabIndex).Setting = base.Settings.Comment;
        }
예제 #4
0
        public SmartGroupPropertiesTabPage(TabbedSettingsDialog dialog, SmartGroupSettings settings)
            : base(dialog, settings, settings.Name)
        {
            _ruleGroup = ((dialog as SmartGroupPropertiesDialog).AssociatedNode as SmartGroup).RuleGroup;
            int rowIndex = 0;
            int tabIndex = 0;

            AddGroupName(ref rowIndex, ref tabIndex);
            AddParentCombo(ref rowIndex, ref tabIndex);
            rowIndex++;
            Label label = new Label
            {
                Location  = FormTools.NewLocation(0, rowIndex++),
                Text      = "符合以下",
                TextAlign = ContentAlignment.MiddleLeft,
                Size      = new Size(56, 20)
            };

            _anyAllCombo = new ValueComboBox <RuleGroupOperator>(Helpers.EnumValues <RuleGroupOperator>(), (RuleGroupOperator v) => v.ToString())
            {
                Location      = new Point(label.Right, label.Top),
                Size          = new Size(50, 20),
                TabIndex      = tabIndex++,
                SelectedValue = RuleGroupOperator.All
            };
            Label label2 = new Label
            {
                Location  = new Point(_anyAllCombo.Right + 5, label.Top),
                Text      = "规则的服务器",
                TextAlign = ContentAlignment.MiddleLeft,
                Size      = new Size(140, 20)
            };

            base.Controls.Add(label, _anyAllCombo, label2);
            GroupBox groupBox = new GroupBox
            {
                Location = FormTools.NewLocation(0, rowIndex++)
            };

            _rulePanel = new Panel
            {
                Location   = FormTools.NewLocation(0, 0),
                AutoScroll = true
            };
            int num = 302 - groupBox.Top - 40;

            _rulePanel.Size = new Size(480, num);
            _rulePanel.VerticalScroll.LargeChange = num;
            _rulePanel.VerticalScroll.SmallChange = num / 20;
            groupBox.Size = new Size(496, num + _rulePanel.Top * 2);
            groupBox.Controls.Add(_rulePanel);
            _nextRuleTabIndex = tabIndex;
            base.Controls.Add(groupBox);
        }
예제 #5
0
 public override void DoPropertiesDialog(Form parentForm, string activeTabName)
 {
     using (TabbedSettingsDialog tabbedSettingsDialog = new TabbedSettingsDialog("最近使用的组设置", "OK", parentForm))
     {
         tabbedSettingsDialog.AddTabPage(base.Properties.CreateTabPage(tabbedSettingsDialog));
         tabbedSettingsDialog.InitButtons();
         if (tabbedSettingsDialog.ShowDialog(parentForm) == DialogResult.OK)
         {
             tabbedSettingsDialog.UpdateSettings();
             RemoveExtra();
             ServerTree.Instance.OnGroupChanged(this, ChangeType.PropertyChanged);
         }
     }
 }
예제 #6
0
        public ImportServersPropertiesPage(TabbedSettingsDialog dialog)
            : base(dialog, (SettingsGroup)null, "Server Settings")
        {
            int   tabIndex = 0;
            int   num      = 0;
            Label value    = new Label
            {
                Location = FormTools.NewLocation(0, num),
                Size     = new Size(480, 48),
                Text     = "选择包含服务器信息的文件,或在下面的文本框中输入信息。 服务器名称由逗号和换行符分隔。 允许扩展。"
            };

            num += 2;
            base.Controls.Add(value);
            Button browseButton = new Button
            {
                TabIndex = tabIndex++,
                Text     = "&B浏览"
            };

            browseButton.Click           += OnBrowseClick;
            _fileNameTextBox              = FormTools.AddLabeledTextBox(this, "&File name:", ref num, ref tabIndex);
            _fileNameTextBox.Enabled      = true;
            _fileNameTextBox.Width       -= browseButton.Width + 8;
            browseButton.Location         = new Point(_fileNameTextBox.Right + 8, _fileNameTextBox.Top);
            _serversTextBox               = FormTools.NewTextBox(1, num, tabIndex++, 7);
            _serversTextBox.AcceptsReturn = true;
            _serversTextBox.Enabled       = true;
            _serversTextBox.ScrollBars    = ScrollBars.Vertical;
            num += 6;
            base.Controls.Add(browseButton, _serversTextBox);
            AddParentCombo(ref num, ref tabIndex);
            RdcTextBox   fileNameTextBox = _fileNameTextBox;
            EventHandler value2          = delegate
            {
                _serversTextBox.Enabled = string.IsNullOrEmpty(_fileNameTextBox.Text);
            };

            fileNameTextBox.TextChanged += value2;
            _serversTextBox.TextChanged += delegate
            {
                RdcTextBox fileNameTextBox2 = _fileNameTextBox;
                bool       enabled          = browseButton.Enabled = string.IsNullOrEmpty(_serversTextBox.Text);
                fileNameTextBox2.Enabled = enabled;
            };
            base.FocusControl = _fileNameTextBox;
        }
예제 #7
0
        public RemoteDesktopTabPage(TabbedSettingsDialog dialog, RemoteDesktopSettings settings)
            : base(dialog, settings)
        {
            int tabIndex = 0;
            int rowIndex = 0;

            CreateInheritanceControl(ref rowIndex, ref tabIndex);
            ValueComboBox <int> previousGroupBox = FormTools.AddLabeledValueDropDown(this, "Color Depth", settings.ColorDepth, ref rowIndex, ref tabIndex, (int v) => v.ToString(), new int[5]
            {
                8,
                15,
                16,
                24,
                32
            });
            RadioButton value = new RdcRadioButton
            {
                Setting = settings.DesktopSizeSameAsClientAreaSize,
                Size    = new Size(140, 24),
                Text    = "&Same as client area"
            };
            RadioButton value2 = new RdcRadioButton
            {
                Setting = settings.DesktopSizeFullScreen,
                Size    = new Size(140, 24),
                Text    = "&Full screen"
            };

            _rdsCustomRadio      = new RadioButton();
            _rdsCustomButton     = new Button();
            _rdsCustomRadio.Size = new Size(72, 24);
            _rdsCustomRadio.Text = "&Custom";
            _rdsSizeGroup        = new GroupBox();
            _rdsSizeGroup.Controls.AddRange(FormTools.NewSizeRadios());
            _rdsSizeGroup.Controls.Add(value);
            _rdsSizeGroup.Controls.Add(value2);
            _rdsSizeGroup.Controls.Add(_rdsCustomRadio);
            _rdsSizeGroup.Text = "Remote Desktop Size";
            FormTools.LayoutGroupBox(_rdsSizeGroup, 2, previousGroupBox);
            _rdsCustomButton.Location = new Point(_rdsCustomRadio.Right + 10, _rdsCustomRadio.Location.Y);
            _rdsCustomButton.TabIndex = _rdsCustomRadio.TabIndex + 1;
            _rdsCustomButton.Click   += CustomSizeClick;
            _rdsCustomButton.Text     = Program.TheForm.GetClientSize().ToFormattedString();
            _rdsSizeGroup.Controls.Add(_rdsCustomButton);
            base.Controls.Add(_rdsSizeGroup);
        }
예제 #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;
                }
예제 #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);
        }
예제 #10
0
        public ServerPropertiesTabPage(TabbedSettingsDialog dialog, ServerSettings settings)
            : base(dialog, settings, "Server Settings")
        {
            int tabIndex = 0;
            int rowIndex = 0;

            _serverNameTextBox                        = FormTools.AddLabeledTextBox(this, "&Server name:", base.Settings.ServerName, ref rowIndex, ref tabIndex);
            _serverNameTextBox.Enabled                = true;
            _serverNameTextBox.TextChanged           += ServerNameChanged;
            _serverNameTextBox.Validate               = ValidateServerName;
            _vmConsoleConnectCheckBox                 = FormTools.NewCheckBox("&VM console connect", 0, rowIndex, tabIndex++, 140);
            _vmConsoleConnectCheckBox.CheckedChanged += VMConsoleConnectCheckBox_CheckedChanged;
            _vmIdLabel = new Label
            {
                Location  = FormTools.NewLocation(1, rowIndex++),
                Size      = new Size(30, 20),
                Text      = "&id:",
                TextAlign = ContentAlignment.MiddleLeft,
                Visible   = false
            };
            _vmIdTextBox = new RdcTextBox
            {
                Location = new Point(_vmIdLabel.Right, _vmIdLabel.Top),
                Setting  = base.Settings.VirtualMachineId,
                Size     = new Size(340 - _vmIdLabel.Width, 20),
                TabIndex = tabIndex++,
                Visible  = false
            };
            _displayNameTextBox              = FormTools.AddLabeledTextBox(this, "&Display name:", base.Settings.DisplayName, ref rowIndex, ref tabIndex);
            _displayNameTextBox.Enabled      = true;
            _displayNameTextBox.TextChanged += DisplayNameChanged;
            _displayNameTextBox.Validate     = ValidateDisplayName;
            _displayNameUserCreated          = !base.Settings.ServerName.Value.Equals(base.Settings.DisplayName.Value);
            AddParentCombo(ref rowIndex, ref tabIndex);
            AddComment(ref rowIndex, ref tabIndex).Setting = base.Settings.Comment;
            base.Controls.Add(_vmConsoleConnectCheckBox, _vmIdLabel, _vmIdTextBox);
            base.FocusControl = _serverNameTextBox;
        }
예제 #11
0
        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);
        }
예제 #12
0
        public GroupDisplaySettingsTabPage(TabbedSettingsDialog dialog, GroupDisplaySettings settings)
            : base(dialog, settings)
        {
            Create(out int rowIndex, out int tabIndex);
            _previewCheckBox              = FormTools.AddCheckBox(this, "ÒÔËõÂÔͼԤÀÀ»á»°", settings.SessionThumbnailPreview, 0, ref rowIndex, ref tabIndex);
            _interactionCheckBox          = FormTools.AddCheckBox(this, "ÔÊÐíËõÂÔͼ»á»°½»»¥", settings.AllowThumbnailSessionInteraction, 0, ref rowIndex, ref tabIndex);
            _interactionCheckBox.Location = new Point(_previewCheckBox.Left + 24, _interactionCheckBox.Top);
            RdcCheckBox  previewCheckBox = _previewCheckBox;
            EventHandler value           = delegate
            {
                PreviewCheckBoxChanged();
            };

            previewCheckBox.CheckedChanged += value;
            if (base.InheritanceControl != null)
            {
                base.InheritanceControl.EnabledChanged += delegate
                {
                    PreviewCheckBoxChanged();
                };
            }
            FormTools.AddCheckBox(this, "ÏÔʾ¶Ï¿ªµÄËõÂÔͼ", settings.ShowDisconnectedThumbnails, 0, ref rowIndex, ref tabIndex);
        }
예제 #13
0
 protected NodePropertiesPage(TabbedSettingsDialog dialog, TSettingsGroup settings, string name)
     : base(dialog, settings, name)
 {
 }
예제 #14
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     return(new SmartGroupPropertiesTabPage(dialog, this));
 }
예제 #15
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     throw new NotImplementedException();
 }
예제 #16
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     return(new GatewaySettingsTabPage(dialog, this));
 }
예제 #17
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     return(new LogonCredentialsTabPage(dialog, this));
 }
예제 #18
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     return(new RemoteDesktopTabPage(dialog, this));
 }
예제 #19
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     return(new LocalResourcesTabPage(dialog, this));
 }
예제 #20
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     return(new EncryptionSettingsTabPage(dialog, this));
 }
예제 #21
0
 public GatewaySettingsTabPage(TabbedSettingsDialog dialog, GatewaySettings settings)
     : base(dialog, settings)
 {
 }
예제 #22
0
 public abstract TabPage CreateTabPage(TabbedSettingsDialog dialog);
예제 #23
0
 public override TabPage CreateTabPage(TabbedSettingsDialog dialog)
 {
     return(new RecentlyUsedSettingsTabPage(dialog, this));
 }
예제 #24
0
 protected DisplaySettingsTabPage(TabbedSettingsDialog dialog, TSettingsGroup settings)
     : base(dialog, settings)
 {
 }