Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DataContractAttribute.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
6 {
7  /// <summary>
8  /// Indicates that a class can be serialized.
9  /// </summary>
10  [AttributeUsage(AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Class, Inherited = false)]
11  public class DataContractAttribute : Attribute
12  {
13  private readonly string alias;
14 
15  /// <summary>
16  /// Initializes a new instance of the <see cref="DataContractAttribute"/> class.
17  /// </summary>
19  {
20  }
21 
22  /// <summary>
23  /// Initializes a new instance of the <see cref="DataContractAttribute"/> class.
24  /// </summary>
25  /// <param name="aliasName">The type alias name when serializing to a textual format.</param>
26  public DataContractAttribute(string aliasName)
27  {
28  this.alias = aliasName;
29  }
30 
31  /// <summary>
32  /// Gets or sets the alias name when serializing to a textual format.
33  /// </summary>
34  /// <value>The alias name.</value>
35  public string Alias
36  {
37  get
38  {
39  return alias;
40  }
41  }
42 
43  /// <summary>
44  /// Gets or sets a value indicating whether this <see cref="DataContractAttribute"/> is implicitly inherited by all its descendant classes.
45  /// </summary>
46  /// <value><c>true</c> if inherited; otherwise, <c>false</c>.</value>
47  public bool Inherited { get; set; }
48  }
49 }
DataContractAttribute(string aliasName)
Initializes a new instance of the DataContractAttribute class.
DataContractAttribute()
Initializes a new instance of the DataContractAttribute class.
Indicates that a class can be serialized.