internal void LoadModXmlFromIro(string pathToIroFile)
        {
            try
            {
                Mod parsedMod = new ModImporter().ParseModXmlFromSource(pathToIroFile);

                if (parsedMod == null)
                {
                    Sys.Message(new WMessage(ResourceHelper.Get(StringKey.CouldNotLoadModXmlFromIroFile), true));
                    return;
                }

                IDInput           = parsedMod.ID.ToString();
                NameInput         = parsedMod.Name;
                CategoryInput     = ResourceHelper.Get(ModLoadOrder.GetCategoryKey(parsedMod.Category));
                AuthorInput       = parsedMod.Author;
                DescriptionInput  = parsedMod.Description;
                VersionInput      = parsedMod.LatestVersion.Version.ToString();
                MetaVersionInput  = "1.00";
                PreviewImageInput = "";
                TagsInput         = "";
                InfoLinkInput     = parsedMod.Link;
                ReleaseNotesInput = parsedMod.LatestVersion.ReleaseNotes;
                ReleaseDateInput  = parsedMod.LatestVersion.ReleaseDate.ToString("MM/dd/yyyy");

                if (string.IsNullOrWhiteSpace(CategoryInput))
                {
                    CategoryInput = ResourceHelper.Get(StringKey.Unknown);
                }

                DownloadLinkList.Clear();
                AddEmptyDownloadLink();
                _modToEdit = null;
            }
            catch (Exception e)
            {
                Sys.Message(new WMessage($"{ResourceHelper.Get(StringKey.CouldNotLoadModXmlFromIroFile)}: {e.Message}", true)
                {
                    LoggedException = e
                });
            }
        }
        internal void LoadModXml(string pathToModXml)
        {
            try
            {
                ModInfo mod = new ModInfo(pathToModXml, Sys._context);

                IDInput           = mod.ID.ToString();
                NameInput         = mod.Name;
                CategoryInput     = ResourceHelper.Get(ModLoadOrder.GetCategoryKey(mod.Category));
                AuthorInput       = mod.Author;
                DescriptionInput  = mod.Description;
                VersionInput      = mod.Version.ToString();
                PreviewImageInput = "";
                TagsInput         = "";
                InfoLinkInput     = mod.Link;
                ReleaseNotesInput = mod.ReleaseNotes;
                ReleaseDateInput  = mod.ReleaseDate.ToString("MM/dd/yyyy");

                if (string.IsNullOrWhiteSpace(CategoryInput))
                {
                    CategoryInput = ResourceHelper.Get(StringKey.Unknown);
                }
                MetaVersionInput = "1.00";

                DownloadLinkList.Clear();
                AddEmptyDownloadLink();

                _modToEdit = null;
            }
            catch (Exception e)
            {
                Sys.Message(new WMessage($"{ResourceHelper.Get(StringKey.CouldNotLoadModXml)}: {e.Message}", true)
                {
                    LoggedException = e
                });
            }
        }
Exemplo n.º 3
0
        internal void LoadModXml(string pathToFile)
        {
            try
            {
                LoadedMod = new ModInfo(pathToFile, Sys._context);

                IDInput           = LoadedMod.ID.ToString();
                NameInput         = LoadedMod.Name;
                CategoryInput     = ResourceHelper.Get(ModLoadOrder.GetCategoryKey(LoadedMod.Category));
                AuthorInput       = LoadedMod.Author;
                DescriptionInput  = LoadedMod.Description;
                VersionInput      = LoadedMod.Version.ToString();
                PreviewImageInput = LoadedMod.PreviewFile;
                InfoLinkInput     = LoadedMod.Link;
                ReleaseNotesInput = LoadedMod.ReleaseNotes;
            }
            catch (Exception e)
            {
                Sys.Message(new WMessage($"{ResourceHelper.Get(StringKey.CouldNotLoadModXml)}: {e.Message}", true)
                {
                    LoggedException = e
                });
            }
        }