Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AssetFactoryAttribute.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Assets
6 {
7  /// <summary>
8  /// Attribute to define for a <see cref="IAssetFactory"/> for a <see cref="Asset"/>.
9  /// </summary>
10  [AttributeUsage(AttributeTargets.Class)]
11  public sealed class AssetFactoryAttribute : Attribute
12  {
13  private readonly string typeName;
14 
15  /// <summary>
16  /// Gets the name of the <see cref="SiliconStudio.Assets.AssetFactoryAttribute"/> type
17  /// </summary>
18  /// <value>The name of the serializable type.</value>
19  public string FactoryTypeName
20  {
21  get { return this.typeName; }
22  }
23 
24  /// <summary>
25  /// Initializes a new instance of the <see cref="SiliconStudio.Assets.AssetFactoryAttribute"/> class.
26  /// </summary>
27  /// <param name="type">The type must be of type <see cref="IAssetFactory"/>.</param>
28  public AssetFactoryAttribute(Type type)
29  {
30  this.typeName = type != null ? type.AssemblyQualifiedName : null;
31  }
32 
33  /// <summary>
34  /// Initializes a new instance of the <see cref="SiliconStudio.Assets.AssetFactoryAttribute"/> class.
35  /// </summary>
36  /// <param name="typeName">The type must be of type <see cref="IAssetFactory"/>.</param>
37  public AssetFactoryAttribute(string typeName)
38  {
39  this.typeName = typeName != null ? typeName.ToUpperInvariant() : null;
40  }
41  }
42 }
Attribute to define for a IAssetFactory for a Asset.
AssetFactoryAttribute(Type type)
Initializes a new instance of the SiliconStudio.Assets.AssetFactoryAttribute class.
AssetFactoryAttribute(string typeName)
Initializes a new instance of the SiliconStudio.Assets.AssetFactoryAttribute class.