-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathPackageSetting.cs
More file actions
56 lines (50 loc) · 1.59 KB
/
PackageSetting.cs
File metadata and controls
56 lines (50 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
using System.Xml;
namespace NUnit.Engine
{
/// <summary>
/// Abstract base for all generic package Settings
/// </summary>
public abstract class PackageSetting
{
/// <summary>
/// Construct a PackageSetting
/// </summary>
/// <param name="name">The name of this setting.</param>
/// <param name="value">The value of the setting</param>
protected PackageSetting(string name, object value)
{
Name = name;
Value = value;
}
/// <summary>
/// Gets the name of this setting.
/// </summary>
public string Name { get; }
/// <summary>
/// Gets the value of this setting as an object.
/// </summary>
public object Value { get; }
}
/// <summary>
/// The PackageSetting class represents one setting value contained in a
/// TestPackage. Instances of PackageSetting are immutable.
/// </summary>
public sealed class PackageSetting<T> : PackageSetting
where T : notnull
{
/// <summary>
/// Construct a PackageSetting
/// </summary>
/// <param name="name">The setting name.</param>
/// <param name="value">The value of this setting instance.</param>
public PackageSetting(string name, T value) : base(name, value)
{
Value = value;
}
/// <summary>
/// Get the setting value
/// </summary>
public new T Value { get; }
}
}