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


C# Framework.GetPlugins方法代码示例

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


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

示例1: SettingsPanel

        public SettingsPanel(Framework.Interfaces.ICore core)
        {
            InitializeComponent();

            this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INFO);
            this.buttonClear.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEAR);

            List<Framework.Data.ShortcutInfo> scuts = core.ShortcutInfo;
            List<Framework.Interfaces.IPlugin> pins = core.GetPlugins();
            foreach (Framework.Interfaces.IPlugin p in pins)
            {
                List<string> actions = p.GetActionSubactionList('@');
                foreach (string act in actions)
                {
                    string[] parts = act.Split(new char[] { '@' });
                    ListViewItem lvi = new ListViewItem(new string[] { p.GetType().ToString(), Utils.LanguageSupport.Instance.GetTranslation(parts[0]), parts.Length==1?"": Utils.LanguageSupport.Instance.GetTranslation(parts[1]), "" });
                    lvi.Tag = p;
                    listView1.Items.Add(lvi);
                    Framework.Data.ShortcutInfo sc = (from t in scuts where t.PluginType == p.GetType().ToString() && t.PluginAction == parts[0] && (parts.Length==1 || t.PluginSubAction == parts[1]) select t).FirstOrDefault();
                    lvi.SubItems[0].Tag = p.GetType().ToString();
                    lvi.SubItems[1].Tag = parts[0];
                    lvi.SubItems[2].Tag = parts.Length==1?"":parts[1];
                    if (sc != null)
                    {
                        lvi.SubItems[3].Text = sc.ShortcutKeyString;
                        lvi.SubItems[3].Tag = sc.ShortcutKeys;
                    }
                    else
                    {
                        lvi.SubItems[3].Tag = null;
                    }
                }
            }
        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:34,代码来源:SettingsPanel.cs

示例2: 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

示例3: SelectActionForm

        public SelectActionForm(Framework.Interfaces.ICore core)
            : this()
        {
            this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
            this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECT);
            this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PLUGIN);
            this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACTION);
            this.listView1.Columns[2].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SUBACTION);

            char[] sep = new char[]{'|'};
            List<SequenceInfo.ActionInfo> allActions = new List<SequenceInfo.ActionInfo>();
            List<Framework.Interfaces.IPlugin> plugins = core.GetPlugins();
            foreach (var p in plugins)
            {
                List<string> actions = p.GetActionSubactionList(sep[0]);
                foreach (string s in actions)
                {
                    string[] parts = s.Split(sep, 2);
                    SequenceInfo.ActionInfo ai = new SequenceInfo.ActionInfo();
                    ai.Plugin = p.GetType().ToString();
                    ai.Action = parts[0];
                    if (parts.Length == 2)
                    {
                        ai.SubAction = parts[1];
                    }
                    else
                    {
                        ai.SubAction = "";
                    }
                    allActions.Add(ai);
                }
            }
            var allact = (from a in allActions select a).OrderBy(x => x.Plugin).ThenBy(x => x.Action).ThenBy(x => x.SubAction);
            foreach (var a in allact)
            {
                ListViewItem lvi = new ListViewItem(new string[]{
                Utils.LanguageSupport.Instance.GetTranslation(a.Plugin),
                Utils.LanguageSupport.Instance.GetTranslation(a.Action),
                Utils.LanguageSupport.Instance.GetTranslation(a.SubAction)
                });
                lvi.Tag = a;
                listView1.Items.Add(lvi);
            }

            listView1.ListViewItemSorter = new Utils.ListViewColumnSorter();
            (listView1.ListViewItemSorter as Utils.ListViewColumnSorter).SortColumn = 0;
            (listView1.ListViewItemSorter as Utils.ListViewColumnSorter).Order = SortOrder.Ascending;

        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:49,代码来源:SelectActionForm.cs

示例4: SettingsPanel

        public SettingsPanel(Framework.Interfaces.ICore core)
            : this()
        {
            this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INFO);
            this.buttonSort.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SORT);

            //first the selected
            if (Properties.Settings.Default.Startup != null && Properties.Settings.Default.Startup.Count > 0)
            {
                foreach (string s in Properties.Settings.Default.Startup)
                {
                    string[] parts = s.Split(new char[] { '@' }, 2);
                    Framework.Interfaces.IPlugin p = Utils.PluginSupport.PluginByName(core, parts[0]);
                    if (p != null)
                    {
                        List<string> actions = p.GetActionSubactionList('@');
                        if (actions.Contains(parts[1]))
                        {
                            string[] act = parts[1].Split(new char[] { '@' });
                            ListViewItem lvi = new ListViewItem(new string[] { p.GetType().ToString(), Utils.LanguageSupport.Instance.GetTranslation(parts[0]), act.Length == 1 ? "" : Utils.LanguageSupport.Instance.GetTranslation(act[1]), "" });
                            lvi.Tag = s;
                            lvi.Checked = true;
                            listView1.Items.Add(lvi);
                        }
                    }
                }
            }

            List<Framework.Interfaces.IPlugin> pins = core.GetPlugins();
            foreach (Framework.Interfaces.IPlugin p in pins)
            {
                List<string> actions = p.GetActionSubactionList('@');
                foreach (string act in actions)
                {
                    string stag = string.Format("{0}@{1}", p.GetType(), act);
                    if ((Properties.Settings.Default.Startup == null || !Properties.Settings.Default.Startup.Contains(stag)))
                    {
                        string[] parts = act.Split(new char[] { '@' });
                        ListViewItem lvi = new ListViewItem(new string[] { p.GetType().ToString(), Utils.LanguageSupport.Instance.GetTranslation(parts[0]), parts.Length == 1 ? "" : Utils.LanguageSupport.Instance.GetTranslation(parts[1]), "" });
                        lvi.Tag = stag;
                        lvi.Checked = false;
                        listView1.Items.Add(lvi);
                    }
                }
            }
            ListViewColumnSorter lvs = new ListViewColumnSorter();            
            listView1.ListViewItemSorter = lvs;
            listView1.Sort();
        }
开发者ID:RH-Code,项目名称:GAPP,代码行数:49,代码来源:SettingsPanel.cs

示例5: FormMain


//.........这里部分代码省略.........

            //file toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.InternalStorage, "Save", "", Properties.Resources.database_save, toolStripFile));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.InternalStorage, "New", "", Properties.Resources.database_add, toolStripFile));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.InternalStorage, "Open", "", Properties.Resources.database, toolStripFile));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.ExportData, "Export Garmin POI", "All", Properties.Resources.exportpoi, toolStripFile));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.ExportData, "Export Garmin POI", "Selected", Properties.Resources.exportpoisel, toolStripFile));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.ImportData, "Import GCVote", "All", Properties.Resources.gcvote, toolStripFile));

            //search toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.GeocacheSelectFilter, "Search geocache", "", Properties.Resources.magnifier__plus, toolStripSearch));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.GeocacheSelectFilter, "Search geocache by text", "", Properties.Resources.magnifier__pencil, toolStripSearch));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.GeocacheSelectFilter, "Quick Select", "Clear selection", Properties.Resources.deselect_all, toolStripSearch));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.GeocacheSelectFilter, "Quick Select", "Select All", Properties.Resources.select_all, toolStripSearch));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.GeocacheSelectFilter, "Select geocaches by area", "", Properties.Resources.selectarea, toolStripSearch));

            //script toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.PluginManager, "Package manager", "", Properties.Resources.download, toolStripScripts));

            //windows toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Chat", "", Properties.Resources.chat, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Generate statistics", "", Properties.Resources.statistics, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Geocache Editor", "", Properties.Resources.gcedit, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Waypoint Editor", "", Properties.Resources.wpedit, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "View Geocache", "", Properties.Resources.view, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Simple cache list", "", Properties.Resources.list, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Solver", "", Properties.Resources.solver, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Web browser", "", Properties.Resources.browser, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.GenericWindow, "Presets", "Splitscreen", Properties.Resources.Icon_Split, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "GCVote dashboard", "", Properties.Resources.gcvote, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.GeocacheCollection, "Geocache collections", "", Properties.Resources.categories, toolStripWindows));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.UIChildWindow, "Formula Solver", "", Properties.Resources.mathematics, toolStripWindows));

            //maps toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Map, "Google Map", "", Properties.Resources.google, toolStripMaps));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Map, "OpenLayers Map", "", Properties.Resources.openlayers, toolStripMaps));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Map, "Open street map - online", "", Properties.Resources.osm, toolStripMaps));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Map, "Open street map - offline", "", Properties.Resources.maps, toolStripMaps));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Map, "Google road map - online", "", Properties.Resources.google2, toolStripMaps));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Map, "Open areas", "", Properties.Resources.holes, toolStripMaps));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Map, "Google Earth", "", Properties.Resources.googleearth, toolStripMaps));

            //Live API toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.LiveAPI, "Import Pocket Queries", "", Properties.Resources.dbimport, toolStripLiveAPI));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.LiveAPI, "Import geocaches", "", Properties.Resources.Importgc, toolStripLiveAPI));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.LiveAPI, "Log geocache", "Single", Properties.Resources.found, toolStripLiveAPI));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.LiveAPI, "Log geocache", "Selected", Properties.Resources.foundmore, toolStripLiveAPI));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.LiveAPI, "Image Gallery", "", Properties.Resources.image, toolStripLiveAPI));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.LiveAPI, "Trackable groups", "", Properties.Resources.travelbug, toolStripLiveAPI));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.LiveAPI, "Log trackables", "", Properties.Resources._48, toolStripLiveAPI));

            //actions toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Action, "Action builder", "Editor", Properties.Resources.Flowchart, toolStripActions));
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Action, "Action builder", "Download and publish", Properties.Resources.server, toolStripActions));

            //actions sequence toolbar
            _toolbarActionProperties.Add(new ToolbarActionProperties(Framework.PluginType.Action, "Action sequence", "Edit", Properties.Resources.sequence, toolStripActionSequence));

            _notificationContainer = new NotificationContainer(this);
            _notificationContainer.Visible = false;
            this.Controls.Add(_notificationContainer);
            _frmProgress = FormProgressHandler.Create(core, this);
            UpdateLocations();
            UpdateCountStatus();

            this.Icon = Properties.Resources.Globalcaching;
            bool maximize = PluginSettings.Instance.WindowMaximized;
            if (PluginSettings.Instance.WindowPos != null && !PluginSettings.Instance.WindowPos.IsEmpty)
            {
                this.Bounds = PluginSettings.Instance.WindowPos;
            }
            if (maximize)
            {
                this.WindowState = FormWindowState.Maximized;
            }

            SelectedLanguageChanged(this, EventArgs.Empty);

            List<Framework.Interfaces.IPlugin> pl = core.GetPlugins();
            foreach (Framework.Interfaces.IPlugin p in pl)
            {
                p.Notification += new Framework.EventArguments.NotificationEventHandler(p_Notification);
            }
            core.PluginAdded += new Framework.EventArguments.PluginEventHandler(core_PluginAdded);


            core.ShortcutInfoChanged += new EventHandler(core_ShortcutInfoChanged);
            core.ActiveGeocacheChanged += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);

            core_ActiveGeocacheChanged(this, null);

            foreach( ToolStripMenuItem p in toolStripSplitButtonTranslate.DropDownItems)
            {
                if (p.Tag != null && p.Tag.ToString() == PluginSettings.Instance.SelectedTranslater)
                {
                    toolStripSplitButtonTranslate.Image = p.Image;
                }
            }
            
        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:101,代码来源:FormMain.cs

示例6: PluginByName

 public static Framework.Interfaces.IPlugin PluginByName(Framework.Interfaces.ICore core, string pluginName)
 {
     List<Framework.Interfaces.IPlugin> pins = core.GetPlugins();
     return (from a in pins where a.GetType().ToString().ToLower() == pluginName.ToLower() select a).FirstOrDefault();
 }
开发者ID:RH-Code,项目名称:GAPP,代码行数:5,代码来源:PluginSupport.cs

示例7: 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

示例8: FormProgressHandler

        private FormProgressHandler(Framework.Interfaces.ICore core, Form owner)
        {
            _owner = owner;
            _context = SynchronizationContext.Current;
            if (_context == null)
            {
                _context = new SynchronizationContext();
            }

            List<Framework.Interfaces.IPlugin> pl = core.GetPlugins();
            foreach (Framework.Interfaces.IPlugin p in pl)
            {
                p.EndProgress += new Framework.EventArguments.ProgressEventHandler(p_EndProgress);
                p.StartProgress += new Framework.EventArguments.ProgressEventHandler(p_StartProgress);
                p.UpdateProgress += new Framework.EventArguments.ProgressEventHandler(p_UpdateProgress);
            }
            core.PluginAdded += new Framework.EventArguments.PluginEventHandler(core_PluginAdded);
        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:18,代码来源:FormProgress.cs


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