Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DataMemberAttribute.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  /// Specify the way to store a property or field of some class or structure.
9  /// </summary>
10  [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
11  public sealed class DataMemberAttribute : Attribute
12  {
13  private readonly DataMemberMode mode;
14  private readonly string name;
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
18  /// </summary>
19  /// <param name="order">The order.</param>
20  public DataMemberAttribute(int order)
21  {
22  Order = order;
23  }
24 
25  /// <summary>
26  /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
27  /// </summary>
28  /// <param name="name">The name.</param>
29  public DataMemberAttribute(string name)
30  {
31  this.name = name;
32  }
33 
34  /// <summary>
35  /// Specify the way to store a property or field of some class or structure.
36  /// </summary>
37  /// <param name="name">The name.</param>
38  /// <param name="mode">The serialize method.</param>
39  public DataMemberAttribute(string name, DataMemberMode mode)
40  {
41  this.name = name;
42  this.mode = mode;
43  }
44 
45  /// <summary>
46  /// Specify the way to store a property or field of some class or structure.
47  /// </summary>
48  /// <param name="mode">The serialize method.</param>
50  {
51  this.mode = mode;
52  }
53 
54  /// <summary>
55  /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
56  /// </summary>
57  /// <param name="order">The order.</param>
58  /// <param name="mode">The mode.</param>
59  public DataMemberAttribute(int order, DataMemberMode mode)
60  {
61  Order = order;
62  this.mode = mode;
63  }
64 
65  /// <summary>
66  /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
67  /// </summary>
68  /// <param name="order">The order.</param>
69  /// <param name="name">The name.</param>
70  /// <param name="mode">The mode.</param>
71  public DataMemberAttribute(int order, string name, DataMemberMode mode)
72  {
73  Order = order;
74  this.name = name;
75  this.mode = mode;
76  }
77 
78  /// <summary>
79  /// Gets the name.
80  /// </summary>
81  /// <value>The name.</value>
82  public string Name
83  {
84  get { return name; }
85  }
86 
87  /// <summary>
88  /// Gets the serialize method1.
89  /// </summary>
90  /// <value>The serialize method1.</value>
91  public DataMemberMode Mode
92  {
93  get { return mode; }
94  }
95 
96 
97  /// <summary>
98  /// Gets or sets the order. Default is -1 (default to alphabetical)
99  /// </summary>
100  /// <value>The order.</value>
101  public int? Order { get; set; }
102  }
103 }
Specify the way to store a property or field of some class or structure.
DataMemberAttribute(int order)
Initializes a new instance of the DataMemberAttribute class.
DataMemberAttribute(DataMemberMode mode)
Specify the way to store a property or field of some class or structure.
DataMemberAttribute(string name, DataMemberMode mode)
Specify the way to store a property or field of some class or structure.
DataMemberAttribute(int order, string name, DataMemberMode mode)
Initializes a new instance of the DataMemberAttribute class.
DataMemberAttribute(int order, DataMemberMode mode)
Initializes a new instance of the DataMemberAttribute class.
DataMemberAttribute(string name)
Initializes a new instance of the DataMemberAttribute class.