Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ContentSerializerAttribute.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.Core.Serialization.Contents
6 {
7  /// <summary>
8  /// Allows customization of IContentSerializer through an attribute.
9  /// </summary>
10  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true)]
12  {
13  /// <summary>
14  /// Initializes a new instance of the <see cref="ContentSerializerAttribute"/> class.
15  /// </summary>
16  /// <param name="contentSerializerType">Type of the content serializer.</param>
17  public ContentSerializerAttribute(Type contentSerializerType)
18  {
19  ContentSerializerType = contentSerializerType;
20  }
21 
22  /// <summary>
23  /// Initializes a new instance of the <see cref="ContentSerializerAttribute"/> class.
24  /// </summary>
26  {
27  }
28 
29  /// <summary>
30  /// Gets the type of the content serializer.
31  /// </summary>
32  /// <value>
33  /// The type of the content serializer.
34  /// </value>
35  public Type ContentSerializerType { get; private set; }
36  }
37 
38  [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
39  public class ContentSerializerExtensionAttribute : Attribute
40  {
41  public ContentSerializerExtensionAttribute(string supportedExtension)
42  {
43  SupportedExtension = supportedExtension;
44  }
45 
46  public string SupportedExtension { get; private set; }
47  }
48 }
ContentSerializerAttribute()
Initializes a new instance of the ContentSerializerAttribute class.
ContentSerializerAttribute(Type contentSerializerType)
Initializes a new instance of the ContentSerializerAttribute class.
Allows customization of IContentSerializer through an attribute.