Exemplo n.º 1
0
        public static List <ThirdPartyTool> GetTools(IEnumerable <LibraryPlugin> plugins)
        {
            var tools = new List <ThirdPartyTool>();

            if (plugins?.Any() == true)
            {
                foreach (var plugin in plugins.OrderBy(a => a.Name))
                {
                    if (plugin.Client != null && plugin.Client.IsInstalled)
                    {
                        var tool = new ThirdPartyTool()
                        {
                            Client = plugin.Client,
                            Name   = plugin.Name
                        };

                        if (plugin.Client?.Icon != null && File.Exists(plugin.Client.Icon))
                        {
                            tool.Icon = Images.GetImageFromFile(
                                plugin.Client.Icon,
                                System.Windows.Media.BitmapScalingMode.Fant,
                                double.NaN,
                                double.NaN);
                        }

                        tools.Add(tool);
                    }
                }
            }

            return(tools);
        }
Exemplo n.º 2
0
        public static List <ThirdPartyTool> GetDefaultInstalledTools()
        {
            var tools = new List <ThirdPartyTool>();

            if (SteamSettings.IsInstalled)
            {
                var tool = new ThirdPartyTool()
                {
                    Path = Path.Combine(SteamSettings.InstallationPath, "steam.exe"),
                    Name = "Steam"
                };

                tools.Add(tool);
            }

            if (OriginSettings.IsInstalled)
            {
                var tool = new ThirdPartyTool()
                {
                    Path = OriginSettings.ClientExecPath,
                    Name = "Origin"
                };

                tools.Add(tool);
            }

            if (GogSettings.IsInstalled)
            {
                var tool = new ThirdPartyTool()
                {
                    Path = Path.Combine(GogSettings.InstallationPath, "GalaxyClient.exe"),
                    Name = "GOG Galaxy"
                };

                tools.Add(tool);
            }

            if (BattleNetSettings.IsInstalled)
            {
                var tool = new ThirdPartyTool()
                {
                    Path = BattleNetSettings.ClientExecPath,
                    Name = "Battle.net"
                };

                tools.Add(tool);
            }

            if (UplaySettings.IsInstalled)
            {
                var tool = new ThirdPartyTool()
                {
                    Path = UplaySettings.ClientExecPath,
                    Name = "Uplay"
                };

                tools.Add(tool);
            }

            if (EpicLauncherSettings.IsInstalled)
            {
                var tool = new ThirdPartyTool()
                {
                    Path = EpicLauncherSettings.ClientExecPath,
                    Name = "Epic Games Launcher"
                };

                tools.Add(tool);
            }

            return(tools);
        }