Exemplo n.º 1
0
        public static async Task RefreshTocFileFor(IList <Addon> addons)
        {
            foreach (var addon in addons)
            {
                var folder = await StorageFolder.GetFolderFromPathAsync(addon.AbsolutePath);

                var tocFile = await Toc.FolderToTocFile(folder);

                addon.Title       = tocFile.Title;
                addon.Version     = tocFile.Version;
                addon.GameVersion = tocFile.GameVersion;
            }
        }
Exemplo n.º 2
0
        public static async Task FolderToGame(Game game, StorageFolder folder)
        {
            var tocFile = await Task.Run(() => Toc.FolderToTocFile(folder));

            if (tocFile == null || tocFile.IsKnownSubFolder)
            {
                return;
            }
            var a = new Addon(game, tocFile.StorageFolder.Name, tocFile.StorageFolder.Path)
            {
                Version     = tocFile.Version,
                GameVersion = tocFile.GameVersion,
                Title       = tocFile.Title
            };

            game.Addons.Add(a);
            await Task.Delay(500);

            await FindProjectUrlAndDownLoadVersionsFor(a);
        }