private void LoadOptions(PluginOptions options)
        {
            if (options.ModeSelectionEnabled)
            {
                modeSelectionPanel.Visible = true;
                selectProfileRadio.Enabled = fromFileRadio.Enabled = fromFolderRadio.Enabled = true;
                if (options.Mode == ProfileCreateMode.LoadFromFolder)
                {
                    fromFolderRadio.Checked = true;
                }
                else if (options.Mode == ProfileCreateMode.LoadFromFile)
                {
                    fromFileRadio.Checked = true;
                }
                else
                {
                    selectProfileRadio.Checked = true;
                }
            }
            else
            {
                selectProfileRadio.Checked = true;
                modeSelectionPanel.Visible = false;
                selectProfileRadio.Enabled = fromFileRadio.Enabled = fromFolderRadio.Enabled = false;
            }

            _selectProfilesControl.SelectProfiles(options.SelectedProfiles);
            _selectFileControl.Path   = options.LoadFromFile;
            _selectFolderControl.Path = options.LoadFromFolder;
        }
        private void LoadTree(AdapterConfiguration a)
        {
            List <Control> tempList = new List <Control>();

            foreach (var p in a.Plugins.Plugins)
            {
                if (p is ISessionable)
                {
                    RadioButton b = new RadioButton()
                    {
                        Text = p.Name,
                        Tag  = p,
                        Dock = DockStyle.Top
                    };
                    b.BringToFront();
                    b.CheckedChanged += OnCheckedChanged;

                    placeHolder.Controls.Add(b);
                    tempList.Add(b);

                    var option = new PluginOptions();
                    option.ModeSelectionEnabled = false;

                    _sessionFiles[p] = option;
                }
            }

            foreach (var c in tempList)
            {
                c.BringToFront();
            }
        }
コード例 #3
0
        private void LoadTree(AdapterConfiguration a)
        {
            TreeNode node = new TreeNode("adapter");

            node.Tag = a;

            treeView.Nodes.Add(node);

            TreeNode logging = new TreeNode(a.Logging.Name)
            {
                Tag = a.Logging
            };

            node.Nodes.Add(logging);

            TreeNode plugins = new TreeNode(a.Plugins.Name)
            {
                Tag = a.Plugins
            };

            node.Nodes.Add(plugins);

            foreach (var p in a.Plugins.Plugins)
            {
                if (p is ISessionable)
                {
                    var pNode = new TreeNode(p.Name)
                    {
                        Tag = p
                    };

                    var option = new PluginOptions();

                    if (p.Name.StartsWith("goose"))
                    {
                        option.ModeSelectionEnabled = false;
                    }

                    _sessionFiles[p] = option;

                    plugins.Nodes.Add(pNode);
                }
                else
                {
                    var pNode = new TreeNode(p.Name)
                    {
                        Tag       = p,
                        ForeColor = Color.Gray
                    };
                    plugins.Nodes.Add(pNode);
                }
            }

            treeView.ExpandAll();
        }