TimberlAndRE Posted June 22, 2020 Share Posted June 22, 2020 (edited) Hi there, i want to reload the (playlist).xmls by a plugin i found the "ReloadIfNeeded()" Method, but how do i use it? can anyone give me an example? here's my code so far. the message box is shown, but the xml isn't reloaded (i changed the xml-file manually before) using System; using System.Collections.Generic; using Unbroken.LaunchBox.Plugins; using Unbroken.LaunchBox.Plugins.Data; using System.Windows.Forms; namespace ReloadXML { public class Relxml : IGameLaunchingPlugin, IDataManager { public void OnGameExited() { // here the reloading should happen... ReloadIfNeeded() MessageBox.Show("Reloaded!"); } public void ReloadIfNeeded() { } public void ForceReload() { throw new NotImplementedException(); } public IEmulator AddNewEmulator() { throw new NotImplementedException(); } public IGame AddNewGame(string title) { throw new NotImplementedException(); } public IPlatform AddNewPlatform(string name) { throw new NotImplementedException(); } public IPlatformCategory AddNewPlatformCategory(string name) { throw new NotImplementedException(); } public IPlaylist AddNewPlaylist(string name) { throw new NotImplementedException(); } public void BackgroundReloadSave(Action changes) { throw new NotImplementedException(); } public IEmulator[] GetAllEmulators() { throw new NotImplementedException(); } public IGame[] GetAllGames() { throw new NotImplementedException(); } public IParent[] GetAllParents() { throw new NotImplementedException(); } public IPlatformCategory[] GetAllPlatformCategories() { throw new NotImplementedException(); } public IPlatform[] GetAllPlatforms() { throw new NotImplementedException(); } public IPlaylist[] GetAllPlaylists() { throw new NotImplementedException(); } public IEmulator GetEmulatorById(string id) { throw new NotImplementedException(); } public IGame GetGameById(string id) { throw new NotImplementedException(); } public IPlatform GetPlatformByName(string name) { throw new NotImplementedException(); } public IPlatformCategory GetPlatformCategoryByName(string name) { throw new NotImplementedException(); } public IPlaylist GetPlaylistById(string id) { throw new NotImplementedException(); } public IList<IPlatform> GetRootPlatformsCategoriesPlaylists() { throw new NotImplementedException(); } public void OnAfterGameLaunched(IGame game, IAdditionalApplication app, IEmulator emulator) { return; } public void OnBeforeGameLaunching(IGame game, IAdditionalApplication app, IEmulator emulator) { return; } public void Save(bool wait = false) { throw new NotImplementedException(); } public bool TryRemoveEmulator(IEmulator emulator) { throw new NotImplementedException(); } public bool TryRemoveGame(IGame game) { throw new NotImplementedException(); } public bool TryRemovePlatform(IPlatform platform) { throw new NotImplementedException(); } public bool TryRemovePlatformCategory(IPlatformCategory platformCategory) { throw new NotImplementedException(); } public bool TryRemovePlaylist(IPlaylist playlist) { throw new NotImplementedException(); } } } thx in advance Timber Edited June 22, 2020 by TimberlAndRE Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted June 23, 2020 Share Posted June 23, 2020 Try this instead PluginHelper.LaunchBoxMainViewModel.RefreshData(); Quote Link to comment Share on other sites More sharing options...
jayjay Posted June 23, 2020 Share Posted June 23, 2020 (edited) Im guessing @TimberlAndRE is trying to make changes to the xml file outside of LB and then reload the files. I dont think RefreshData() will work. I havent really used the reload methods but if I remember correctly you want to be careful with it. I think if the user makes any changes to their collection without saving (closing LB), them changes will be lost when calling reload. Maybe you can call a save method before reload but im not expert, not sure if its wise to do it. Edited June 23, 2020 by jayjay Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.