Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AssetDescriptionAttribute.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  /// Associates user-friendly names and descriptions to an asset type.
9  /// </summary>
10  [AttributeUsage(AttributeTargets.Class)]
11  public sealed class AssetDescriptionAttribute : Attribute
12  {
13  private readonly AssetDescription assetDescription;
14 
15  /// <summary>
16  /// Gets the display name of the asset
17  /// </summary>
18  public string DisplayName { get { return assetDescription.DisplayName; } }
19 
20  /// <summary>
21  /// Gets a description of the asset.
22  /// </summary>
23  public string Description { get { return assetDescription.Description; } }
24 
25  /// <summary>
26  /// Gets whether the thumbnails of the asset type are dynamic and should be regenerated each time a property changes.
27  /// </summary>
28  public bool DynamicThumbnails { get { return assetDescription.DynamicThumbnails; } }
29 
30  /// <summary>
31  /// Initializes a new instance of the <see cref="AssetDescriptionAttribute"/> class.
32  /// </summary>
33  /// <param name="displayName">A user-friendly name describing the asset type.</param>
34  /// <param name="description">A sentence describing the purpose of the asset type.</param>
35  /// <param name="dynamicThumbnails">Indicates that the thumbnails of the asset type are dynamic and should be regenerated each time a property changes.</param>
36  public AssetDescriptionAttribute(string displayName, string description, bool dynamicThumbnails)
37  {
38  assetDescription = new AssetDescription(displayName, description, dynamicThumbnails);
39  }
40 
41  /// <summary>
42  /// Initializes a new instance of the <see cref="AssetDescriptionAttribute"/> class.
43  /// </summary>
44  /// <param name="displayName">A user-friendly name describing the asset type.</param>
45  /// <param name="description">A sentence describing the purpose of the asset type.</param>
46  public AssetDescriptionAttribute(string displayName, string description)
47  : this(displayName, description, false)
48  {
49  }
50 
51  internal AssetDescription GetDescription()
52  {
53  return assetDescription;
54  }
55  }
56 }
AssetDescriptionAttribute(string displayName, string description, bool dynamicThumbnails)
Initializes a new instance of the AssetDescriptionAttribute class.
AssetDescriptionAttribute(string displayName, string description)
Initializes a new instance of the AssetDescriptionAttribute class.
document false
Contains user-friendly names and descriptions of an asset type.
Associates user-friendly names and descriptions to an asset type.