Class Plugin
Represents base Playnite plugin.
public abstract class Plugin : IDisposable, IIdentifiable
- Inheritance
-
Plugin
- Implements
- Derived
- Inherited Members
Constructors
Plugin(IPlayniteAPI)
Creates new instance of Plugin.
public Plugin(IPlayniteAPI playniteAPI)
Parameters
playniteAPI
IPlayniteAPIInstance of Playnite API to be injected.
Fields
PlayniteApi
Gets instance of runtime IPlayniteAPI.
public readonly IPlayniteAPI PlayniteApi
Field Value
Properties
Id
Gets unique object identifier.
public abstract Guid Id { get; }
Property Value
Searches
Gets or sets list of global searches.
public List<SearchSupport> Searches { get; set; }
Property Value
Methods
AddConvertersSupport(AddConvertersSupportArgs)
public void AddConvertersSupport(AddConvertersSupportArgs args)
Parameters
AddCustomElementSupport(AddCustomElementSupportArgs)
public void AddCustomElementSupport(AddCustomElementSupportArgs args)
Parameters
AddSettingsSupport(AddSettingsSupportArgs)
public void AddSettingsSupport(AddSettingsSupportArgs args)
Parameters
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public virtual void Dispose()
GetGameMenuItems(GetGameMenuItemsArgs)
Gets list of items to be displayed in game's context menu.
public virtual IEnumerable<GameMenuItem> GetGameMenuItems(GetGameMenuItemsArgs args)
Parameters
args
GetGameMenuItemsArgsContextual arguments.
Returns
- IEnumerable<GameMenuItem>
List of menu items to be displayed in game menu.
GetGameViewControl(GetGameViewControlArgs)
public virtual Control GetGameViewControl(GetGameViewControlArgs args)
Parameters
Returns
GetInstallActions(GetInstallActionsArgs)
public virtual IEnumerable<InstallController> GetInstallActions(GetInstallActionsArgs args)
Parameters
Returns
GetMainMenuItems(GetMainMenuItemsArgs)
Gets list of items to be displayed in Playnite's main menu.
public virtual IEnumerable<MainMenuItem> GetMainMenuItems(GetMainMenuItemsArgs args)
Parameters
args
GetMainMenuItemsArgsContextual arguments.
Returns
- IEnumerable<MainMenuItem>
List of menu items to be displayed in Playnite's main menu.
GetPlayActions(GetPlayActionsArgs)
public virtual IEnumerable<PlayController> GetPlayActions(GetPlayActionsArgs args)
Parameters
args
GetPlayActionsArgs
Returns
GetPluginConfiguration<TConfig>()
Gets plugin configuration stored in plugin.cfg file.
public TConfig GetPluginConfiguration<TConfig>() where TConfig : class
Returns
- TConfig
Plugin configuration.
Type Parameters
TConfig
Plugin configuration type.
GetPluginUserDataPath()
Gets path dedicated for plugins to store data.
public string GetPluginUserDataPath()
Returns
- string
Full directory path.
GetSearchGlobalCommands()
Gets items to be included in default global search.
public virtual IEnumerable<SearchItem> GetSearchGlobalCommands()
Returns
GetSettings(bool)
Gets plugin settings or null if plugin doesn't provide any settings.
public virtual ISettings GetSettings(bool firstRunSettings)
Parameters
firstRunSettings
bool
Returns
GetSettingsView(bool)
Gets plugin settings view or null if plugin doesn't provide settings view.
public virtual UserControl GetSettingsView(bool firstRunView)
Parameters
firstRunView
bool
Returns
GetSidebarItems()
Gets sidebar items provided by this plugin.
public virtual IEnumerable<SidebarItem> GetSidebarItems()
Returns
GetTopPanelItems()
Gets top panel items provided by this plugin.
public virtual IEnumerable<TopPanelItem> GetTopPanelItems()
Returns
GetUninstallActions(GetUninstallActionsArgs)
public virtual IEnumerable<UninstallController> GetUninstallActions(GetUninstallActionsArgs args)
Parameters
Returns
LoadPluginSettings<TSettings>()
Gets plugin settings.
public TSettings LoadPluginSettings<TSettings>() where TSettings : class
Returns
- TSettings
Plugin settings.
Type Parameters
TSettings
Plugin settings type.
OnApplicationStarted(OnApplicationStartedEventArgs)
Called when appliaction is started and initialized.
public virtual void OnApplicationStarted(OnApplicationStartedEventArgs args)
Parameters
OnApplicationStopped(OnApplicationStoppedEventArgs)
Called when appliaction is shutting down.
public virtual void OnApplicationStopped(OnApplicationStoppedEventArgs args)
Parameters
OnGameInstalled(OnGameInstalledEventArgs)
Called when game has been installed.
public virtual void OnGameInstalled(OnGameInstalledEventArgs args)
Parameters
OnGameSelected(OnGameSelectedEventArgs)
Called when game selection changed.
public virtual void OnGameSelected(OnGameSelectedEventArgs args)
Parameters
OnGameStarted(OnGameStartedEventArgs)
Called when game has started.
public virtual void OnGameStarted(OnGameStartedEventArgs args)
Parameters
OnGameStarting(OnGameStartingEventArgs)
Called before game is started.
public virtual void OnGameStarting(OnGameStartingEventArgs args)
Parameters
OnGameStartupCancelled(OnGameStartupCancelledEventArgs)
Called when game startup is cancelled.
public virtual void OnGameStartupCancelled(OnGameStartupCancelledEventArgs args)
Parameters
OnGameStopped(OnGameStoppedEventArgs)
Called when game stopped running.
public virtual void OnGameStopped(OnGameStoppedEventArgs args)
Parameters
OnGameUninstalled(OnGameUninstalledEventArgs)
Called when game has been uninstalled.
public virtual void OnGameUninstalled(OnGameUninstalledEventArgs args)
Parameters
OnLibraryUpdated(OnLibraryUpdatedEventArgs)
Called when library update has been finished.
public virtual void OnLibraryUpdated(OnLibraryUpdatedEventArgs args)
Parameters
OpenSettingsView()
Opens plugin's settings view. Only works in Desktop application mode!
public bool OpenSettingsView()
Returns
- bool
True if user saved any changes, False if dialog was canceled.
SavePluginSettings<TSettings>(TSettings)
Saves plugin settings.
public void SavePluginSettings<TSettings>(TSettings settings) where TSettings : class
Parameters
settings
TSettingsSource plugin.
Type Parameters
TSettings
Plugin settings type.