Example #1
0
            public static async void AddNewAsync(string LibraryPath)
            {
                try
                {
                    if (string.IsNullOrEmpty(LibraryPath))
                    {
                        return;
                    }

                    if (!LibraryPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
                    {
                        LibraryPath += Path.DirectorySeparatorChar;
                    }

                    Definitions.SteamLibrary Library = new Definitions.SteamLibrary(LibraryPath)
                    {
                        Type          = Definitions.Enums.LibraryType.SLM,
                        DirectoryInfo = new DirectoryInfo(LibraryPath)
                    };

                    Definitions.List.LibraryProgress.Report(Library);

                    if (Directory.Exists(LibraryPath))
                    {
                        await Task.Run(() => Library.UpdateAppListAsync()).ConfigureAwait(true);

                        await Task.Run(() => Library.UpdateJunks()).ConfigureAwait(true);
                    }
                }
                catch (Exception ex)
                {
                    logger.Fatal(ex);
                    MessageBox.Show(ex.ToString());
                }
            }