Table of Contents

Class Plugin

Namespace
Playnite.SDK.Plugins
Assembly
Playnite.SDK.dll

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 IPlayniteAPI

Instance of Playnite API to be injected.

Fields

PlayniteApi

Gets instance of runtime IPlayniteAPI.

public readonly IPlayniteAPI PlayniteApi

Field Value

IPlayniteAPI

Properties

Id

Gets unique object identifier.

public abstract Guid Id { get; }

Property Value

Guid

Searches

Gets or sets list of global searches.

public List<SearchSupport> Searches { get; set; }

Property Value

List<SearchSupport>

Methods

AddConvertersSupport(AddConvertersSupportArgs)

public void AddConvertersSupport(AddConvertersSupportArgs args)

Parameters

args AddConvertersSupportArgs

AddCustomElementSupport(AddCustomElementSupportArgs)

public void AddCustomElementSupport(AddCustomElementSupportArgs args)

Parameters

args AddCustomElementSupportArgs

AddSettingsSupport(AddSettingsSupportArgs)

public void AddSettingsSupport(AddSettingsSupportArgs args)

Parameters

args AddSettingsSupportArgs

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 GetGameMenuItemsArgs

Contextual arguments.

Returns

IEnumerable<GameMenuItem>

List of menu items to be displayed in game menu.

GetGameViewControl(GetGameViewControlArgs)

public virtual Control GetGameViewControl(GetGameViewControlArgs args)

Parameters

args GetGameViewControlArgs

Returns

Control

GetInstallActions(GetInstallActionsArgs)

public virtual IEnumerable<InstallController> GetInstallActions(GetInstallActionsArgs args)

Parameters

args GetInstallActionsArgs

Returns

IEnumerable<InstallController>

GetMainMenuItems(GetMainMenuItemsArgs)

Gets list of items to be displayed in Playnite's main menu.

public virtual IEnumerable<MainMenuItem> GetMainMenuItems(GetMainMenuItemsArgs args)

Parameters

args GetMainMenuItemsArgs

Contextual 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

IEnumerable<PlayController>

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

IEnumerable<SearchItem>

GetSettings(bool)

Gets plugin settings or null if plugin doesn't provide any settings.

public virtual ISettings GetSettings(bool firstRunSettings)

Parameters

firstRunSettings bool

Returns

ISettings

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

UserControl

GetSidebarItems()

Gets sidebar items provided by this plugin.

public virtual IEnumerable<SidebarItem> GetSidebarItems()

Returns

IEnumerable<SidebarItem>

GetTopPanelItems()

Gets top panel items provided by this plugin.

public virtual IEnumerable<TopPanelItem> GetTopPanelItems()

Returns

IEnumerable<TopPanelItem>

GetUninstallActions(GetUninstallActionsArgs)

public virtual IEnumerable<UninstallController> GetUninstallActions(GetUninstallActionsArgs args)

Parameters

args GetUninstallActionsArgs

Returns

IEnumerable<UninstallController>

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

args OnApplicationStartedEventArgs

OnApplicationStopped(OnApplicationStoppedEventArgs)

Called when appliaction is shutting down.

public virtual void OnApplicationStopped(OnApplicationStoppedEventArgs args)

Parameters

args OnApplicationStoppedEventArgs

OnGameInstalled(OnGameInstalledEventArgs)

Called when game has been installed.

public virtual void OnGameInstalled(OnGameInstalledEventArgs args)

Parameters

args OnGameInstalledEventArgs

OnGameSelected(OnGameSelectedEventArgs)

Called when game selection changed.

public virtual void OnGameSelected(OnGameSelectedEventArgs args)

Parameters

args OnGameSelectedEventArgs

OnGameStarted(OnGameStartedEventArgs)

Called when game has started.

public virtual void OnGameStarted(OnGameStartedEventArgs args)

Parameters

args OnGameStartedEventArgs

OnGameStarting(OnGameStartingEventArgs)

Called before game is started.

public virtual void OnGameStarting(OnGameStartingEventArgs args)

Parameters

args OnGameStartingEventArgs

OnGameStartupCancelled(OnGameStartupCancelledEventArgs)

Called when game startup is cancelled.

public virtual void OnGameStartupCancelled(OnGameStartupCancelledEventArgs args)

Parameters

args OnGameStartupCancelledEventArgs

OnGameStopped(OnGameStoppedEventArgs)

Called when game stopped running.

public virtual void OnGameStopped(OnGameStoppedEventArgs args)

Parameters

args OnGameStoppedEventArgs

OnGameUninstalled(OnGameUninstalledEventArgs)

Called when game has been uninstalled.

public virtual void OnGameUninstalled(OnGameUninstalledEventArgs args)

Parameters

args OnGameUninstalledEventArgs

OnLibraryUpdated(OnLibraryUpdatedEventArgs)

Called when library update has been finished.

public virtual void OnLibraryUpdated(OnLibraryUpdatedEventArgs args)

Parameters

args OnLibraryUpdatedEventArgs

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 TSettings

Source plugin.

Type Parameters

TSettings

Plugin settings type.