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

A registry for file extensions, IAssetImporter, IAssetFactory and aliases associated with assets. More...

Static Public Member Functions

static void RegisterSupportedPlatforms (List< SolutionPlatform > platforms)
 Registers the supported platforms. More...
 
static void RegisterStringExpander (Func< object, string, string > expander)
 Registers the string expander used by the package references. More...
 
static string ExpandString (object context, string stringToExpand)
 Expands a string using the registered string expander (RegisterStringExpander) More...
 
static string[] GetAssetFileExtensions ()
 Gets the asset file extensions. More...
 
static bool IsAssetFileExtension (string extension)
 Determines whether the extension is an asset file type. More...
 
static string GetDefaultExtension (Type assetType)
 Gets the default extension associated with an asset. More...
 
static int GetFormatVersion (Type assetType)
 Gets the current format version of an asset. More...
 
static Type[] GetFormatVersionUpdaterTypes (Type assetType)
 Gets the current format version of an asset. More...
 
static string GetDefaultExtension< T > ()
 Gets the default extension associated with an asset. More...
 
static Type[] GetInstantiableTypes ()
 Returns an array of asset types that can be instanced with NewDefaultInstance. More...
 
static AssetDescription GetDescription (Type assetType)
 Gets the description associated to the asset type, if available. More...
 
static Type[] GetDescribedTypes ()
 Returns an array of asset types that have a description. More...
 
static Asset NewDefaultInstance (Type assetType)
 Creates a default instance for an asset type. More...
 
static bool IsImporterSupportingExtension (string extension)
 Determines whether [is importer supporting extension] [the specified extension]. More...
 
static IEnumerable
< IAssetImporter
FindImporterByExtension (string extension)
 Finds the importer associated with an asset by the extension of the file to import. More...
 
static IAssetImporter FindImporterById (Guid importerId)
 Finds an importer by its id. More...
 
static void RegisterImporter (IAssetImporter importer)
 Registers a IAssetImporter for the specified asset type. More...
 
static void RegisterFactory (Type assetType, IAssetFactory factory)
 Registers a IAssetFactory for the specified asset type. More...
 
static void RegisterDescription (Type assetType, AssetDescription description)
 Registers a AssetDescription for the specified asset type. More...
 
static void RegisterAssembly (Assembly assembly)
 Registers the asset assembly. This assembly should provide Asset objects, associated with ICompiler and optionaly a IAssetImporter. More...
 

Properties

static SolutionPlatformCollection SupportedPlatforms [get]
 Gets the supported platforms. More...
 
static IEnumerable
< IAssetImporter
RegisteredImporters [get]
 Gets an enumeration of registered importers. More...
 

Detailed Description

A registry for file extensions, IAssetImporter, IAssetFactory and aliases associated with assets.

Definition at line 22 of file AssetRegistry.cs.

Member Function Documentation

static string SiliconStudio.Assets.AssetRegistry.ExpandString ( object  context,
string  stringToExpand 
)
static

Expands a string using the registered string expander (RegisterStringExpander)

Parameters
contextThe context.
stringToExpandThe string to expand.
Returns
System.String.

Definition at line 79 of file AssetRegistry.cs.

Referenced by SiliconStudio.Assets.PackageSession.Save().

static IEnumerable<IAssetImporter> SiliconStudio.Assets.AssetRegistry.FindImporterByExtension ( string  extension)
static

Finds the importer associated with an asset by the extension of the file to import.

Parameters
extensionThe extension of the file to import.
Returns
An instance of the importer of null if not found.

Definition at line 245 of file AssetRegistry.cs.

static IAssetImporter SiliconStudio.Assets.AssetRegistry.FindImporterById ( Guid  importerId)
static

Finds an importer by its id.

Parameters
importerIdThe importer identifier.
Returns
An instance of the importer of null if not found.

Definition at line 266 of file AssetRegistry.cs.

static string [] SiliconStudio.Assets.AssetRegistry.GetAssetFileExtensions ( )
static

Gets the asset file extensions.

Returns
System.String[][].

Definition at line 92 of file AssetRegistry.cs.

static string SiliconStudio.Assets.AssetRegistry.GetDefaultExtension ( Type  assetType)
static

Gets the default extension associated with an asset.

Parameters
assetTypeThe type.
Returns
System.String.

Definition at line 128 of file AssetRegistry.cs.

Gets the default extension associated with an asset.

Template Parameters
TType of the asset.
Returns
System.String.
Type Constraints
T :Asset 

Definition at line 167 of file AssetRegistry.cs.

static Type [] SiliconStudio.Assets.AssetRegistry.GetDescribedTypes ( )
static

Returns an array of asset types that have a description.

Returns
An array of Type elements.

Definition at line 198 of file AssetRegistry.cs.

static AssetDescription SiliconStudio.Assets.AssetRegistry.GetDescription ( Type  assetType)
static

Gets the description associated to the asset type, if available.

Parameters
assetTypeType of the asset.
Returns
Am AssetDescription object, if available, or null otherwise.

Definition at line 186 of file AssetRegistry.cs.

static int SiliconStudio.Assets.AssetRegistry.GetFormatVersion ( Type  assetType)
static

Gets the current format version of an asset.

Parameters
assetTypeThe asset type.
Returns
The current format version of this asset.

Definition at line 141 of file AssetRegistry.cs.

static Type [] SiliconStudio.Assets.AssetRegistry.GetFormatVersionUpdaterTypes ( Type  assetType)
static

Gets the current format version of an asset.

Parameters
assetTypeThe asset type.
Returns
The current format version of this asset.

Definition at line 154 of file AssetRegistry.cs.

Referenced by SiliconStudio.Assets.AssetMigration.MigrateAssetIfNeeded().

static Type [] SiliconStudio.Assets.AssetRegistry.GetInstantiableTypes ( )
static

Returns an array of asset types that can be instanced with NewDefaultInstance.

Returns
An array of Type elements.

Definition at line 176 of file AssetRegistry.cs.

static bool SiliconStudio.Assets.AssetRegistry.IsAssetFileExtension ( string  extension)
static

Determines whether the extension is an asset file type.

Parameters
extensionThe extension.
Returns
true if [is asset file extension] [the specified extension]; otherwise, false.

Definition at line 117 of file AssetRegistry.cs.

Referenced by SiliconStudio.Assets.Package.LoadTemporaryAssets().

static bool SiliconStudio.Assets.AssetRegistry.IsImporterSupportingExtension ( string  extension)
static

Determines whether [is importer supporting extension] [the specified extension].

Parameters
extensionThe extension.
Returns
true if [is importer supporting extension] [the specified extension]; otherwise, false.
Exceptions
System.ArgumentNullExceptionextension

Definition at line 230 of file AssetRegistry.cs.

static Asset SiliconStudio.Assets.AssetRegistry.NewDefaultInstance ( Type  assetType)
static

Creates a default instance for an asset type.

Parameters
assetTypeType of the asset.
Returns
A new default instance of an asset.

Definition at line 208 of file AssetRegistry.cs.

static void SiliconStudio.Assets.AssetRegistry.RegisterAssembly ( Assembly  assembly)
static

Registers the asset assembly. This assembly should provide Asset objects, associated with ICompiler and optionaly a IAssetImporter.

Parameters
assemblyThe assembly.
Exceptions
System.ArgumentNullExceptionassembly
AssetExceptionInvalid compiler type [{0}], must inherit from IAssetImporter.ToFormat(assetCompiler.CompilerTypeName) or Unable to instantiate compiler [{0}].ToFormat(assetCompiler.CompilerTypeName) or Invalid importer type [{0}], must inherit from IAssetImporter.ToFormat(assetImporter.ImpoterTypeName) or Unable to instantiate importer [{0}].ToFormat(assetImporter.ImpoterTypeName)

Definition at line 356 of file AssetRegistry.cs.

static void SiliconStudio.Assets.AssetRegistry.RegisterDescription ( Type  assetType,
AssetDescription  description 
)
static

Registers a AssetDescription for the specified asset type.

Parameters
assetTypeType of the asset.
descriptionThe description.

Definition at line 334 of file AssetRegistry.cs.

static void SiliconStudio.Assets.AssetRegistry.RegisterFactory ( Type  assetType,
IAssetFactory  factory 
)
static

Registers a IAssetFactory for the specified asset type.

Parameters
assetTypeType of the asset.
factoryThe factory.

Definition at line 323 of file AssetRegistry.cs.

static void SiliconStudio.Assets.AssetRegistry.RegisterImporter ( IAssetImporter  importer)
static

Registers a IAssetImporter for the specified asset type.

Parameters
importerThe importer.
Exceptions
System.ArgumentNullExceptionimporter

Definition at line 284 of file AssetRegistry.cs.

References SiliconStudio.Assets.IAssetImporter.Id.

static void SiliconStudio.Assets.AssetRegistry.RegisterStringExpander ( Func< object, string, string >  expander)
static

Registers the string expander used by the package references.

Parameters
expanderThe expander.

Definition at line 68 of file AssetRegistry.cs.

static void SiliconStudio.Assets.AssetRegistry.RegisterSupportedPlatforms ( List< SolutionPlatform platforms)
static

Registers the supported platforms.

Parameters
platformsThe platforms.
Exceptions
System.ArgumentNullExceptionplatforms

Definition at line 56 of file AssetRegistry.cs.

Property Documentation

IEnumerable<IAssetImporter> SiliconStudio.Assets.AssetRegistry.RegisteredImporters
staticget

Gets an enumeration of registered importers.

The registered importers.

Definition at line 102 of file AssetRegistry.cs.

SolutionPlatformCollection SiliconStudio.Assets.AssetRegistry.SupportedPlatforms
staticget

Gets the supported platforms.

The supported platforms.

Definition at line 44 of file AssetRegistry.cs.


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