14.1 Beta 1 SDK
IDataManager7.10
public interface Unbroken.LaunchBox.Plugins.Data.IDataManager
This interface provides access to all data in LaunchBox/Big Box. Use the Unbroken.LaunchBox.Plugins.PluginHelper's static Unbroken.LaunchBox.Plugins.PluginHelper.DataManager property to access the instance methods and read and write LaunchBox data.
Methods
string AddGameController(string controllerName, string controllerCategory, params string[] associatedPlatforms)Unbroken.LaunchBox.Plugins.Data.IEmulator AddNewEmulator()Unbroken.LaunchBox.Plugins.Data.IGame AddNewGame(string title)Unbroken.LaunchBox.Plugins.Data.IPlatform AddNewPlatform(string name)Unbroken.LaunchBox.Plugins.Data.IPlatformCategory AddNewPlatformCategory(string name)Unbroken.LaunchBox.Plugins.Data.IPlaylist AddNewPlaylist(string name)void BackgroundReloadSave(System.Action changes)void ForceReload()Unbroken.LaunchBox.Plugins.Data.IEmulator[] GetAllEmulators()Unbroken.LaunchBox.Plugins.Data.IGame[] GetAllGames()Unbroken.LaunchBox.Plugins.Data.IParent[] GetAllParents()Unbroken.LaunchBox.Plugins.Data.IPlatformCategory[] GetAllPlatformCategories()Unbroken.LaunchBox.Plugins.Data.IPlatform[] GetAllPlatforms()Unbroken.LaunchBox.Plugins.Data.IPlaylist[] GetAllPlaylists()Unbroken.LaunchBox.Plugins.Data.IEmulator? GetEmulatorById(string id)Unbroken.LaunchBox.Plugins.Data.IGame? GetGameById(string? id)System.Collections.Generic.IList<Unbroken.LaunchBox.Plugins.Data.IGameController> GetGameControllers()Unbroken.LaunchBox.Plugins.Data.IPlatform? GetPlatformByName(string name)Unbroken.LaunchBox.Plugins.Data.IPlatformCategory GetPlatformCategoryByName(string name)Unbroken.LaunchBox.Plugins.Data.IPlaylist? GetPlaylistById(string id)System.Collections.Generic.IList<Unbroken.LaunchBox.Plugins.Data.IPlatform> GetRootPlatformsCategoriesPlaylists()void ReloadIfNeeded()void Save(bool wait = false)bool TryRemoveEmulator(Unbroken.LaunchBox.Plugins.Data.IEmulator emulator)bool TryRemoveGame(Unbroken.LaunchBox.Plugins.Data.IGame game)bool TryRemovePlatform(Unbroken.LaunchBox.Plugins.Data.IPlatform platform)bool TryRemovePlatformCategory(Unbroken.LaunchBox.Plugins.Data.IPlatformCategory platformCategory)bool TryRemovePlaylist(Unbroken.LaunchBox.Plugins.Data.IPlaylist playlist)
AddGameController 11.12
string AddGameController(string controllerName, string controllerCategory, params string[] associatedPlatforms)AddNewEmulator 7.10
Unbroken.LaunchBox.Plugins.Data.IEmulator AddNewEmulator()
Adds a new Emulator to the user's collection.
Returns
The new Emulator.AddNewGame 7.10
Unbroken.LaunchBox.Plugins.Data.IGame AddNewGame(string title)
Adds a new Game to the user's collection.
title7.10- The Title to use for the new Game.
Returns
The new Game.AddNewPlatform 7.10
Unbroken.LaunchBox.Plugins.Data.IPlatform AddNewPlatform(string name)
Adds a new Platform to the user's collection.
name7.10- The Name of the Platform to add.
Returns
The new Platform.AddNewPlatformCategory 7.10
Unbroken.LaunchBox.Plugins.Data.IPlatformCategory AddNewPlatformCategory(string name)
Adds a new Platform Category to the user's collection.
name7.10- The Name of the Platform Category to add.
Returns
The new Platform CategoryAddNewPlaylist 7.10
Unbroken.LaunchBox.Plugins.Data.IPlaylist AddNewPlaylist(string name)
Adds a new Playlist to the user's collection.
name7.10- The Name of the Playlist to add.
Returns
The new Playlist.BackgroundReloadSave 7.10
void BackgroundReloadSave(System.Action changes)
Recommended instead of other Reload and Save methods when quickly saving a single or small amount of values in the data. Completely avoids Dropbox, Google Drive, etc. sync issues by making sure that all changed data is loaded from disk before making the specified changes.
changes7.10- The specified changes to make to the data. A method or an inline expression may be provided here that changes the data as needed after reloading any necessary data from disk, and before saving the new values to disk.
ForceReload 7.10
void ForceReload()
Forces all data to be reloaded from XML files. This method should only ever be necessary to call when significant changes are made to the XML files by something other than the LaunchBox or Big Box applications.
GetAllEmulators 7.10
Unbroken.LaunchBox.Plugins.Data.IEmulator[] GetAllEmulators()
Gets all Emulators in the user's collection.
Returns
An array of Emulators.GetAllGames 7.10
Unbroken.LaunchBox.Plugins.Data.IGame[] GetAllGames()
Gets all Games in the user's collection.
Returns
An array of Games.GetAllParents 8.8
Unbroken.LaunchBox.Plugins.Data.IParent[] GetAllParents()
Gets all Parents in the user's collection.
Returns
An array of Parents.GetAllPlatformCategories 7.10
Unbroken.LaunchBox.Plugins.Data.IPlatformCategory[] GetAllPlatformCategories()
Gets all Platform Categories in the user's collection.
Returns
An array of Platform Categories.GetAllPlatforms 7.10
Unbroken.LaunchBox.Plugins.Data.IPlatform[] GetAllPlatforms()
Gets all Platforms in the user's collection.
Returns
An array of Platforms.GetAllPlaylists 7.10
Unbroken.LaunchBox.Plugins.Data.IPlaylist[] GetAllPlaylists()
Gets all Playlists in the user's collection.
Returns
An array of Playlists.GetEmulatorById 7.10
Unbroken.LaunchBox.Plugins.Data.IEmulator? GetEmulatorById(string id)
Get an Emulator by the Emulator's ID.
id7.10- The ID of the Emulator to retrieve. Maps up directly to the Emulator's Unbroken.LaunchBox.Plugins.Data.IEmulator.Id property.
Returns
The Emulator with the specified ID, or NULL if not found.GetGameById 7.10
Unbroken.LaunchBox.Plugins.Data.IGame? GetGameById(string? id)
Gets a Game via the Game's ID.
id7.10- The ID of the Game to retrieve. Maps up directly to the Game's Unbroken.LaunchBox.Plugins.Data.IGame.Id property.
Returns
The Game with the specified ID, or NULL if not found.GetGameControllers 11.12
System.Collections.Generic.IList<Unbroken.LaunchBox.Plugins.Data.IGameController> GetGameControllers()
Gets the list of game controllers
Returns
The game controllers registered in the library.GetPlatformByName 7.10
Unbroken.LaunchBox.Plugins.Data.IPlatform? GetPlatformByName(string name)
Gets a Platform via the Platform's Name.
name7.10- The Name of the Platform to retrieve. Maps up directly to the Platform's Unbroken.LaunchBox.Plugins.Data.IPlatform.Name property.
Returns
The Platform with the associated Name, or NULL if not found.GetPlatformCategoryByName 7.10
Unbroken.LaunchBox.Plugins.Data.IPlatformCategory GetPlatformCategoryByName(string name)
Gets a Platform Category via the Platform Category's Name.
name7.10- The Name of the Platform Category to retrieve. Maps up directly to the Platform Category's Unbroken.LaunchBox.Plugins.Data.IPlatformCategory.Name property.
Returns
The Platform Category with the associated Name, or NULL if not found.GetPlaylistById 7.10
Unbroken.LaunchBox.Plugins.Data.IPlaylist? GetPlaylistById(string id)
Gets a Playlist via the Playlist's ID.
id7.10- The ID of the Playlist to retrieve. Maps up directly to the Playlist's Unbroken.LaunchBox.Plugins.Data.IPlaylist.PlaylistId property.
Returns
The Playlist with the associated ID, or NULL if not found.GetRootPlatformsCategoriesPlaylists 8.8
System.Collections.Generic.IList<Unbroken.LaunchBox.Plugins.Data.IPlatform> GetRootPlatformsCategoriesPlaylists()
Gets the list of root platforms, platform categories, and playlists, which can then be used to parse through children as well.
Returns
A list of root platforms, platform categories, and playlists.ReloadIfNeeded 7.10
void ReloadIfNeeded()
Reloads any changed XML files from disk. Should be called before loading up data to change and save.
Save 7.10
void Save(bool wait = false)
Saves all changes to LaunchBox or Big Box data to disk. Will only save XML files that were changed.
wait7.10- A value specifying whether to wait for the operation to complete. If false is specified, then the save operation will be performed in the background and the method will immediately return.
TryRemoveEmulator 7.10
bool TryRemoveEmulator(Unbroken.LaunchBox.Plugins.Data.IEmulator emulator)
Attempts to remove an Emulator from the user's collection.
emulator7.10- The Emulator to remove.
Returns
A value specifying whether the Emulator was successfully removed. If false is returned, most likely the Emulator was not found in the user's collection.TryRemoveGame 7.10
bool TryRemoveGame(Unbroken.LaunchBox.Plugins.Data.IGame game)
Attempts to remove a Game from the user's collection.
game7.10- The Game to remove.
Returns
A value specifying whether or not the Game was successfully removed. If false is returned, most likely the Game was not found in the user's collection.TryRemovePlatform 7.10
bool TryRemovePlatform(Unbroken.LaunchBox.Plugins.Data.IPlatform platform)
Attempts to remove a Platform from the user's collection.
platform7.10- The Platform to remove.
Returns
A value specifying whether the Platform was successfully removed. If false is returned, most likely the Platform was not found in the user's collection.TryRemovePlatformCategory 7.10
bool TryRemovePlatformCategory(Unbroken.LaunchBox.Plugins.Data.IPlatformCategory platformCategory)
Attempts to remove a Platform Category from the user's collection.
platformCategory7.10- The Platform Category to remove.
Returns
A value specifying whether the Platform Category was successfully removed. If false is returned, most likely the Platform Category was not found in the user's collection.TryRemovePlaylist 7.10
bool TryRemovePlaylist(Unbroken.LaunchBox.Plugins.Data.IPlaylist playlist)
Attempts to remove a Playlist from the user's collection.
playlist7.10- The Playlist to remove.