Table of Contents

Interface IItemCollection<TItem>

Namespace
Playnite.SDK
Assembly
Playnite.SDK.dll

Describes collection of items for game database.

public interface IItemCollection<TItem> : IItemCollection, IDisposable, ICollection<TItem>, IEnumerable<TItem>, IEnumerable where TItem : DatabaseObject

Type Parameters

TItem
Inherited Members
Extension Methods

Properties

this[Guid]

Gets or sets item from collection.

TItem this[Guid id] { get; set; }

Parameters

id Guid

Id of an item.

Property Value

TItem

null if no item is found otherwise item represents by specified id.

Methods

Add(MetadataProperty)

TItem Add(MetadataProperty property)

Parameters

property MetadataProperty

Returns

TItem

Add(IEnumerable<MetadataProperty>)

IEnumerable<TItem> Add(IEnumerable<MetadataProperty> properties)

Parameters

properties IEnumerable<MetadataProperty>

Returns

IEnumerable<TItem>

Add(IEnumerable<TItem>)

Adds items to collection.

void Add(IEnumerable<TItem> items)

Parameters

items IEnumerable<TItem>

Item to be added.

Add(List<string>)

Adds new items into collection.

IEnumerable<TItem> Add(List<string> items)

Parameters

items List<string>

Names of items to be added.

Returns

IEnumerable<TItem>

Newly added items or existing items if there are some present with the same names.

Add(List<string>, Func<TItem, string, bool>)

Adds new items into collection.

IEnumerable<TItem> Add(List<string> items, Func<TItem, string, bool> existingComparer)

Parameters

items List<string>

Names of items to be added.

existingComparer Func<TItem, string, bool>

Method to detect existing item from database compared to new item.

Returns

IEnumerable<TItem>

Add(string)

Adds new item into collection.

TItem Add(string itemName)

Parameters

itemName string

Name of new item.

Returns

TItem

Newly added item or existing item if one is present with the same name.

Add(string, Func<TItem, string, bool>)

Adds new item into collection.

TItem Add(string itemName, Func<TItem, string, bool> existingComparer)

Parameters

itemName string

Name of new item.

existingComparer Func<TItem, string, bool>

Method to detect existing item from database compared to new item.

Returns

TItem

Newly added item or existing item if one is present with the same name.

BeginBufferUpdate()

Sets collection into buffered update state.

void BeginBufferUpdate()

BufferedUpdate()

Switches collection to buffered mode. Suppresses all notification events until buffering is stopped.

IDisposable BufferedUpdate()

Returns

IDisposable

Buffer object.

EndBufferUpdate()

Sets collection from buffered update state.

void EndBufferUpdate()

Get(IList<Guid>)

Gets items from collection.

List<TItem> Get(IList<Guid> ids)

Parameters

ids IList<Guid>

Id of items.

Returns

List<TItem>

List of items from collection.

Get(Guid)

Gets item from collection.

TItem Get(Guid id)

Parameters

id Guid

Id of an item.

Returns

TItem

null if no item is found otherwise item represents by specified id.

GetClone()

Gets clone of a collection.

IEnumerable<TItem> GetClone()

Returns

IEnumerable<TItem>

Remove(IEnumerable<TItem>)

Removes items from collection.

bool Remove(IEnumerable<TItem> items)

Parameters

items IEnumerable<TItem>

List of items to be removed.

Returns

bool

Remove(Guid)

Removes item from collection.

bool Remove(Guid id)

Parameters

id Guid

Id of an item to be removed.

Returns

bool

Update(IEnumerable<TItem>)

Updates states of items in collection.

void Update(IEnumerable<TItem> items)

Parameters

items IEnumerable<TItem>

New states of items.

Update(TItem)

Updates state of item in collection.

void Update(TItem item)

Parameters

item TItem

New state of an object.

Events

ItemCollectionChanged

Occurs when items are added or removed.

event EventHandler<ItemCollectionChangedEventArgs<TItem>> ItemCollectionChanged

Event Type

EventHandler<ItemCollectionChangedEventArgs<TItem>>

ItemUpdated

Occurs when items are updated.

event EventHandler<ItemUpdatedEventArgs<TItem>> ItemUpdated

Event Type

EventHandler<ItemUpdatedEventArgs<TItem>>