Esempio n. 1
0
        public void LoadMru()
        {
            pnlMru.Controls.Clear();

            var list = new List <Control>();

            if (MostRecentlyUsedItems.Instance.Items.Any())
            {
                foreach (var mru in MostRecentlyUsedItems.Instance.Items.OrderBy(i => i.Date))
                {
                    var plugin = pManager.Plugins.FirstOrDefault(p => p.Metadata.Name == mru.PluginName);
                    if (plugin != null)
                    {
                        var ctrl = new MostRecentlyUsedItemControl(plugin.Metadata.BigImageBase64, mru);
                        ctrl.OpenMruPluginRequested += Ctrl_OpenMruPluginRequested;
                        ctrl.RemoveMruRequested     += Ctrl_RemoveRequested;
                        ctrl.ClearMruRequested      += Ctrl_ClearMruRequested;
                        ctrl.Dock = DockStyle.Top;

                        list.Add(ctrl);
                    }
                }

                list.Add(pnlMruSubTitle);
            }

            if (Favorites.Instance.Items.Any())
            {
                foreach (var fav in Favorites.Instance.Items.OrderByDescending(i => i.PluginName))
                {
                    var plugin = pManager.Plugins.FirstOrDefault(p => p.Metadata.Name == fav.PluginName);
                    if (plugin != null)
                    {
                        var ctrl = new FavoriteControl(plugin.Metadata.BigImageBase64, fav);
                        ctrl.OpenFavoritePluginRequested += Ctrl_OpenFavoritePluginRequested;
                        ctrl.RemoveFavoriteRequested     += Ctrl_RemoveFavoriteRequested;
                        ctrl.Dock = DockStyle.Top;

                        list.Add(ctrl);
                    }
                }

                list.Add(pnlFavoritesSubTitle);
            }

            pnlMru.Controls.AddRange(list.ToArray());
        }
Esempio n. 2
0
        public void LoadMru()
        {
            pnlMru.Controls.Clear();

            var list = new List <Control>();

            foreach (var mru in MostRecentlyUsedItems.Instance.Items)
            {
                var plugin = pManager.Plugins.FirstOrDefault(p => p.Metadata.Name == mru.PluginName);
                if (plugin != null)
                {
                    var ctrl = new MostRecentlyUsedItemControl(plugin.Metadata.BigImageBase64, mru);
                    ctrl.OpenMruPluginRequested += Ctrl_OpenMruPluginRequested;
                    ctrl.Dock = DockStyle.Top;

                    list.Add(ctrl);
                }
            }

            pnlMru.Controls.AddRange(list.ToArray());
        }