当前位置: 首页>>代码示例>>C#>>正文


C# Framework.GetAllDetectedPlugins方法代码示例

本文整理汇总了C#中Framework.GetAllDetectedPlugins方法的典型用法代码示例。如果您正苦于以下问题:C# Framework.GetAllDetectedPlugins方法的具体用法?C# Framework.GetAllDetectedPlugins怎么用?C# Framework.GetAllDetectedPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Framework的用法示例。


在下文中一共展示了Framework.GetAllDetectedPlugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FormSettings

        public FormSettings(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin)
            : this()
        {
            this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
            this.tabPageGeneral.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL);
            this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT);
            this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE);
            this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PLUGINS);
            this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY);
            this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
            this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API);
            this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP);
            this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE);
            this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND);

            _core = core;
            _ownerPlugin = ownerPlugin;
            _pluginList = core.GetPlugins();
            List<string> allPlugins = core.GetAllDetectedPlugins();
            checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray());
            foreach (Framework.Interfaces.IPlugin p in _pluginList)
            {
                int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName);
                if (index >= 0)
                {
                    checkedListBoxPlugins.SetItemChecked(index, true);
                }
                List<UserControl> pnls = p.CreateConfigurationPanels();
                if (pnls != null && pnls.Count > 0)
                {
                    _ucList.AddRange(pnls.ToArray());

                    //create tab
                    TabPage tp = new TabPage(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName));
                    tp.AutoScroll = true;
                    tabControlSettings.TabPages.Add(tp);
                    //add controls
                    FlowLayoutPanel fp = new FlowLayoutPanel();
                    tp.Controls.Add(fp);
                    fp.Dock = DockStyle.Fill;
                    fp.Controls.AddRange(pnls.ToArray());
                }
            }
            comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray());
            comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin;
            textBoxUsername.Text = core.GeocachingComAccount.AccountName;
            labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES);
            labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType;
            checkBox1.Checked = core.LoadLogsInBackground;
        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:50,代码来源:FormSettings.cs

示例2: FormSettingsTreeView

        public FormSettingsTreeView(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin)
            : this()
        {
            this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
            this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT);
            this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE);
            this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE);
            this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY);
            this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
            this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API);
            this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP);
            this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND);
            this.checkBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOSAVEONCLOSE);
            this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEARAUTHORIZE);
            this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OTHERACCOUNTNAMES);
            this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX);
            this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME);
            this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX);
            this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME);
            this.checkBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SHOWOKAPIMENU);

            TreeNode tn;
            tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL));
            tn.Tag = panelGeneral;
            treeView1.Nodes.Add(tn);

            foreach (var t in Enum.GetNames(typeof(Framework.PluginType)))
            {
                tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(PluginTypeToString(t)));
                tn.Tag = (Framework.PluginType)Enum.Parse(typeof(Framework.PluginType), t);
                treeView1.Nodes.Add(tn);
            }

            _core = core;
            _ownerPlugin = ownerPlugin;
            _pluginList = core.GetPlugins();
            List<string> allPlugins = core.GetAllDetectedPlugins();
            checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray());
            foreach (Framework.Interfaces.IPlugin p in _pluginList)
            {
                int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName);
                if (index >= 0)
                {
                    checkedListBoxPlugins.SetItemChecked(index, true);
                }
                List<UserControl> pnls = p.CreateConfigurationPanels();
                if (pnls != null && pnls.Count > 0)
                {
                    _ucList.AddRange(pnls.ToArray());
                    int yPos = 0;
                    foreach (UserControl uc in pnls)
                    {
                        uc.Location = new Point(0, yPos);
                        yPos += uc.Height;
                        uc.Visible = false;
                        splitContainer1.Panel2.Controls.Add(uc);
                    }                    

                    foreach (TreeNode t in treeView1.Nodes)
                    {
                        if (t.Tag!=null && t.Tag.GetType()==typeof( Framework.PluginType))
                        {
                            if ((Framework.PluginType)t.Tag == p.PluginType)
                            {
                                tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName));
                                tn.Tag = pnls;
                                t.Nodes.Add(tn);
                                break;
                            }
                        }
                    }
                }
            }
            //delete the plugin nodes with no childs (settings)
            int i = 1;
            while ( i < treeView1.Nodes.Count)
            {
                TreeNode t = treeView1.Nodes[i];
                if (t.Tag != null && t.Tag.GetType() == typeof(Framework.PluginType))
                {
                    if (t.Nodes.Count == 0)
                    {
                        treeView1.Nodes.RemoveAt(i);
                    }
                    else
                    {
                        i++;
                    }
                }
            }

            treeView1.ExpandAll();
            treeView1.SelectedNode = treeView1.Nodes[0];

            comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray());
            comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin;
            textBoxUsername.Text = core.GeocachingComAccount.AccountName;
            labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES);
            labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType;
            checkBox1.Checked = core.LoadLogsInBackground;
//.........这里部分代码省略.........
开发者ID:RH-Code,项目名称:GAPP,代码行数:101,代码来源:FormSettingsTreeView.cs


注:本文中的Framework.GetAllDetectedPlugins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。