示例#1
0
        public void ProcessResult(Result res)
        {
            var item = new ComponentOwl.BetterListView.BetterListViewItem(new string[] { res.Header, res.Description });

            item.Group     = accidentsView.Groups[res.Level];
            item.BackColor = res.Level == 0 ? System.Drawing.Color.Orange : res.Level == 1 ? System.Drawing.Color.Yellow :
                             res.Level == 2 ? System.Drawing.Color.YellowGreen : System.Drawing.Color.LightCyan;
            accidentsView.Items.Add(item);
        }
示例#2
0
        private void LoadPlugins()
        {
            lstMenu.Clear();
            lstMenu.View = ComponentOwl.BetterListView.BetterListViewView.LargeIcon;
            lstMenu.Columns.Add("Thumbnail");
            lstMenu.MultiSelect = false;

            foreach (string s in Directory.GetFiles(Application.StartupPath.ToString(), "*.dll"))
            {
                try
                {
                    Type[] pluginTypes = Assembly.LoadFile(s).GetTypes();
                    foreach (Type t in pluginTypes)
                    {

                        if (t.ToString().Contains(".Factory"))
                        {
                            IPluginFactory plugin = Activator.CreateInstance(t) as IPluginFactory;
                            list_Plugins.Add(plugin);
                            PluginDict.Add(plugin.PluginID(), plugin);
                            var lstItem = new ComponentOwl.BetterListView.BetterListViewItem
                            {
                                Name = plugin.PluginID().ToString(),
                                Text = plugin.GetPluginName(),
                                Image = plugin.GetImage()
                            };

                            lstMenu.Items.Add(lstItem);
                        }
                    }
                }
                catch (TypeLoadException e)
                {
                    MessageBox.Show(e.Message);
                    continue;
                }
            }

               // lstMenu.DataSource = list_Plugins;
        }