コード例 #1
0
        // To add new main menu items override GetMainMenuItems
        public override IEnumerable <MainMenuItem> GetMainMenuItems(GetMainMenuItemsArgs args)
        {
            string MenuInExtensions = string.Empty;

            if (PluginSettings.Settings.MenuInExtensions)
            {
                MenuInExtensions = "@";
            }

            List <MainMenuItem> mainMenuItems = new List <MainMenuItem>();

            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = resources.GetString("LOCLmSetCompanies"),
                Action      = (mainMenuItem) =>
                {
                    LibraryManagementTools libraryManagementTools = new LibraryManagementTools(this, PlayniteApi, PluginSettings.Settings);
                    libraryManagementTools.SetCompanies();
                }
            });
            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = resources.GetString("LOCLmSetFeatures"),
                Action      = (mainMenuItem) =>
                {
                    LibraryManagementTools libraryManagementTools = new LibraryManagementTools(this, PlayniteApi, PluginSettings.Settings);
                    libraryManagementTools.SetFeatures();
                }
            });
            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = resources.GetString("LOCLmSetGenres"),
                Action      = (mainMenuItem) =>
                {
                    LibraryManagementTools libraryManagementTools = new LibraryManagementTools(this, PlayniteApi, PluginSettings.Settings);
                    libraryManagementTools.SetGenres();
                }
            });
            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = resources.GetString("LOCLmSetTags"),
                Action      = (mainMenuItem) =>
                {
                    LibraryManagementTools libraryManagementTools = new LibraryManagementTools(this, PlayniteApi, PluginSettings.Settings);
                    libraryManagementTools.SetTags();
                }
            });
            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = resources.GetString("LOCLmSetTagsToFeatures"),
                Action      = (mainMenuItem) =>
                {
                    LibraryManagementTools libraryManagementTools = new LibraryManagementTools(this, PlayniteApi, PluginSettings.Settings);
                    libraryManagementTools.SetTagsToFeatures();
                }
            });
            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = resources.GetString("LOCLmSetTagsToGenres"),
                Action      = (mainMenuItem) =>
                {
                    LibraryManagementTools libraryManagementTools = new LibraryManagementTools(this, PlayniteApi, PluginSettings.Settings);
                    libraryManagementTools.SetTagsToGenres();
                }
            });

#if DEBUG
            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = "-"
            });
            mainMenuItems.Add(new MainMenuItem
            {
                MenuSection = MenuInExtensions + resources.GetString("LOCLm"),
                Description = "Test",
                Action      = (mainMenuItem) =>
                {
                }
            });
#endif

            return(mainMenuItems);
        }
コード例 #2
0
        private void AutoUpdate(bool OnlyToDay = false, Game gameUpdated = null)
        {
            LibraryManagementTools libraryManagementTools = new LibraryManagementTools(this, PlayniteApi, PluginSettings.Settings);

            if (PluginSettings.Settings.AutoUpdateCompanies)
            {
                try
                {
                    libraryManagementTools.SetCompanies(OnlyToDay, gameUpdated);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, false, true, "LibraryManagement");
                }
            }

            if (PluginSettings.Settings.AutoUpdateGenres)
            {
                try
                {
                    libraryManagementTools.SetGenres(OnlyToDay, gameUpdated);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, false, true, "LibraryManagement");
                }
            }

            if (PluginSettings.Settings.AutoUpdateFeatures)
            {
                try
                {
                    libraryManagementTools.SetFeatures(OnlyToDay, gameUpdated);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, false, true, "LibraryManagement");
                }
            }

            if (PluginSettings.Settings.AutoUpdateTags)
            {
                try
                {
                    libraryManagementTools.SetTags(OnlyToDay, gameUpdated);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, false, true, "LibraryManagement");
                }
            }

            if (PluginSettings.Settings.AutoUpdateTagsToFeatures)
            {
                try
                {
                    libraryManagementTools.SetTagsToFeatures(OnlyToDay, gameUpdated);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, false, true, "LibraryManagement");
                }
            }

            if (PluginSettings.Settings.AutoUpdateTagsToGenres)
            {
                try
                {
                    libraryManagementTools.SetTagsToGenres(OnlyToDay, gameUpdated);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, false, true, "LibraryManagement");
                }
            }
        }
コード例 #3
0
        private void PART_SetFeatures_Click(object sender, RoutedEventArgs e)
        {
            LibraryManagementTools libraryManagementTools = new LibraryManagementTools(_plugin, _PlayniteApi, _settings);

            libraryManagementTools.SetFeatures();
        }