Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
PropertyItem.cs
Go to the documentation of this file.
1 #region License
2 
3 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
4 // This file is distributed under MIT License. See LICENSE.md for details.
5 //
6 // SLNTools
7 // Copyright (c) 2009
8 // by Christian Warren
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
11 // documentation files (the "Software"), to deal in the Software without restriction, including without limitation
12 // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
13 // to permit persons to whom the Software is furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in all copies or substantial portions
16 // of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19 // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 // DEALINGS IN THE SOFTWARE.
23 
24 #endregion
25 
26 using System;
27 
28 namespace SiliconStudio.Core.VisualStudio
29 {
30  /// <summary>
31  /// A key/value pair used by <see cref="PropertyItemCollection" />
32  /// </summary>
33  public sealed class PropertyItem
34  {
35  private readonly string name;
36 
37  /// <summary>
38  /// Initializes a new instance of the <see cref="PropertyItem"/> class.
39  /// </summary>
40  /// <param name="name">The name.</param>
41  /// <param name="value">The value.</param>
42  public PropertyItem(string name, string value)
43  {
44  if (name == null) throw new ArgumentNullException("name");
45  this.name = name;
46  Value = value;
47  }
48 
49  private PropertyItem(PropertyItem original)
50  : this(original.Name, original.Value)
51  {
52  }
53 
54  /// <summary>
55  /// Gets the name.
56  /// </summary>
57  /// <value>The name.</value>
58  public string Name
59  {
60  get
61  {
62  return name;
63  }
64  }
65 
66  /// <summary>
67  /// Gets or sets the value.
68  /// </summary>
69  /// <value>The value.</value>
70  public string Value { get; set; }
71 
72  /// <summary>
73  /// Clones this instance.
74  /// </summary>
75  /// <returns>PropertyItem.</returns>
77  {
78  return new PropertyItem(this);
79  }
80 
81  public override string ToString()
82  {
83  return string.Format("{0} = {1}", Name, Value);
84  }
85  }
86 }
A key/value pair used by PropertyItemCollection
Definition: PropertyItem.cs:33
PropertyItem(string name, string value)
Initializes a new instance of the PropertyItem class.
Definition: PropertyItem.cs:42
PropertyItem Clone()
Clones this instance.
Definition: PropertyItem.cs:76