Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Assets.PackageAssetCollection Class Reference

A collection of AssetItem that contains only absolute location without any drive information. This class cannot be inherited. More...

Inheritance diagram for SiliconStudio.Assets.PackageAssetCollection:
ICollection< AssetItem > ICollection INotifyCollectionChanged SiliconStudio.Assets.IDirtyable

Public Member Functions

 PackageAssetCollection (Package package)
 Initializes a new instance of the PackageAssetCollection class. More...
 
bool ContainsById (Guid assetId)
 Determines whether this instance contains an asset with the specified identifier. More...
 
AssetItem Find (string location)
 Finds an asset by its location. More...
 
AssetItem Find (Guid assetId)
 Finds an asset by its location. More...
 
void Add (AssetItem item)
 Adds an AssetItem to this instance. More...
 
void Clear ()
 Removes all items from this instance. More...
 
bool Contains (AssetItem assetItem)
 Checks this collection contains the specified asset reference, throws an exception if not found. More...
 
void CopyTo (AssetItem[] array, int arrayIndex)
 Copies items to the specified array. More...
 
bool Remove (AssetItem item)
 Removes an AssetItem from this instance. More...
 
bool RemoveById (Guid itemId)
 Removes an AssetItem from this instance. More...
 
void SuspendCollectionChanged ()
 Suspends the collection changed that can happen on this collection. More...
 
void ResumeCollectionChanged ()
 Resumes the collection changed that happened on this collection and fire a NotifyCollectionChangedAction.Reset More...
 
void CheckCanAdd (AssetItem item)
 Checks if the specified item can be add to this collection. More...
 
IEnumerator< AssetItemGetEnumerator ()
 

Properties

Package Package [get]
 Gets the package this collection is attached to. More...
 
bool IsDirty [get, set]
 Gets or sets a value indicating whether this instance is dirty. Sets this flag when moving assets between packages or removing assets. More...
 
int Count [get]
 Gets the number of elements contained in this instance. More...
 
bool IsReadOnly [get]
 Gets a value indicating whether this collection is read-only. Default is false. More...
 
- Properties inherited from SiliconStudio.Assets.IDirtyable
bool IsDirty [get, set]
 Gets or sets a value indicating whether this instance is dirty. More...
 

Events

NotifyCollectionChangedEventHandler CollectionChanged
 Occurs when the collection changes. More...
 

Detailed Description

A collection of AssetItem that contains only absolute location without any drive information. This class cannot be inherited.

Definition at line 20 of file PackageAssetCollection.cs.

Constructor & Destructor Documentation

SiliconStudio.Assets.PackageAssetCollection.PackageAssetCollection ( Package  package)

Initializes a new instance of the PackageAssetCollection class.

Parameters
packageThe package that will contain assets.

Definition at line 48 of file PackageAssetCollection.cs.

Member Function Documentation

void SiliconStudio.Assets.PackageAssetCollection.Add ( AssetItem  item)

Adds an AssetItem to this instance.

Parameters
itemThe item to add to this instance.

Definition at line 118 of file PackageAssetCollection.cs.

void SiliconStudio.Assets.PackageAssetCollection.CheckCanAdd ( AssetItem  item)

Checks if the specified item can be add to this collection.

Parameters
itemThe item.
Exceptions
System.ArgumentNullExceptionitem;Cannot add an empty asset item reference or item;Cannot add an item with an empty asset or item;Cannot add an asset with an empty Id or item;Location cannot be null when adding an asset reference
System.ArgumentExceptionAn asset with the same location is already registered [{0}].ToFormat(location.Path);item or An asset with the same id [{0}] is already registered with the location [{1}].ToFormat(item.Id, location.Path);item or Asset location [{0}] cannot contain drive information.ToFormat(location);item or Asset location [{0}] must be relative and not absolute (not start with '/').ToFormat(location);item or Asset location [{0}] cannot start with relative '..'.ToFormat(location);item

Definition at line 326 of file PackageAssetCollection.cs.

References SiliconStudio.Assets.AssetItem.Id, SiliconStudio.Assets.AssetItem.Package, SiliconStudio.Assets.PackageSession.Packages, and SiliconStudio.Assets.Package.Session.

void SiliconStudio.Assets.PackageAssetCollection.Clear ( )

Removes all items from this instance.

Definition at line 156 of file PackageAssetCollection.cs.

bool SiliconStudio.Assets.PackageAssetCollection.Contains ( AssetItem  assetItem)

Checks this collection contains the specified asset reference, throws an exception if not found.

Parameters
assetItemThe asset item.
Exceptions
System.ArgumentNullExceptionassetItem
System.Collections.Generic.KeyNotFoundExceptionAsset [{0}] was not found.ToFormat(assetItem)

Definition at line 187 of file PackageAssetCollection.cs.

bool SiliconStudio.Assets.PackageAssetCollection.ContainsById ( Guid  assetId)

Determines whether this instance contains an asset with the specified identifier.

Parameters
assetIdThe asset identifier.
Returns
true if this instance contains an asset with the specified identifier; otherwise, false.

Definition at line 82 of file PackageAssetCollection.cs.

void SiliconStudio.Assets.PackageAssetCollection.CopyTo ( AssetItem[]  array,
int  arrayIndex 
)

Copies items to the specified array.

Parameters
arrayThe array.
arrayIndexIndex of the array.

Definition at line 198 of file PackageAssetCollection.cs.

AssetItem SiliconStudio.Assets.PackageAssetCollection.Find ( string  location)

Finds an asset by its location.

Parameters
locationThe location of the assets.
Returns
AssetItem.

Definition at line 92 of file PackageAssetCollection.cs.

AssetItem SiliconStudio.Assets.PackageAssetCollection.Find ( Guid  assetId)

Finds an asset by its location.

Parameters
assetIdThe asset unique identifier.
Returns
AssetItem.

Definition at line 107 of file PackageAssetCollection.cs.

IEnumerator<AssetItem> SiliconStudio.Assets.PackageAssetCollection.GetEnumerator ( )

Definition at line 396 of file PackageAssetCollection.cs.

bool SiliconStudio.Assets.PackageAssetCollection.Remove ( AssetItem  item)

Removes an AssetItem from this instance.

Parameters
itemThe object to remove from the T:System.Collections.Generic.ICollection`1.
Returns
true if item was successfully removed from the T:System.Collections.Generic.ICollection`1; otherwise, false. This method also returns false if item is not found in the original T:System.Collections.Generic.ICollection`1.

Definition at line 208 of file PackageAssetCollection.cs.

bool SiliconStudio.Assets.PackageAssetCollection.RemoveById ( Guid  itemId)

Removes an AssetItem from this instance.

Parameters
itemIdThe item identifier.
Returns
true if itemId was successfully removed from the T:System.Collections.Generic.ICollection`1; otherwise, false. This method also returns false if item is not found in the original T:System.Collections.Generic.ICollection`1.

Definition at line 239 of file PackageAssetCollection.cs.

void SiliconStudio.Assets.PackageAssetCollection.ResumeCollectionChanged ( )

Resumes the collection changed that happened on this collection and fire a NotifyCollectionChangedAction.Reset

Definition at line 260 of file PackageAssetCollection.cs.

void SiliconStudio.Assets.PackageAssetCollection.SuspendCollectionChanged ( )

Suspends the collection changed that can happen on this collection.

Definition at line 252 of file PackageAssetCollection.cs.

Property Documentation

int SiliconStudio.Assets.PackageAssetCollection.Count
get

Gets the number of elements contained in this instance.

Returns
The number of elements contained in this instance.

Definition at line 283 of file PackageAssetCollection.cs.

bool SiliconStudio.Assets.PackageAssetCollection.IsDirty
getset

Gets or sets a value indicating whether this instance is dirty. Sets this flag when moving assets between packages or removing assets.

true if this instance is dirty; otherwise, false.

Definition at line 75 of file PackageAssetCollection.cs.

bool SiliconStudio.Assets.PackageAssetCollection.IsReadOnly
get

Gets a value indicating whether this collection is read-only. Default is false.

Returns
false

Definition at line 295 of file PackageAssetCollection.cs.

Package SiliconStudio.Assets.PackageAssetCollection.Package
get

Gets the package this collection is attached to.

The package.

Definition at line 63 of file PackageAssetCollection.cs.

Event Documentation

NotifyCollectionChangedEventHandler SiliconStudio.Assets.PackageAssetCollection.CollectionChanged

Occurs when the collection changes.

Definition at line 42 of file PackageAssetCollection.cs.


The documentation for this class was generated from the following file: