-
Notifications
You must be signed in to change notification settings - Fork 0
/
KeyedChild.cs
45 lines (38 loc) · 888 Bytes
/
KeyedChild.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Grammophone.GenericContentModel
{
/// <summary>
/// A base implementation for <see cref="IKeyedChild{P, K}"/>.
/// </summary>
/// <typeparam name="P">The type of the parent.</typeparam>
/// <typeparam name="K">The type of the child's key.</typeparam>
[Serializable]
public abstract class KeyedChild<P, K> : Child<P>, IKeyedChild<P, K>
where P : class
{
#region Construction
/// <summary>
/// Create.
/// </summary>
/// <param name="key">The key of the child.</param>
public KeyedChild(K key)
{
if (key == null) throw new ArgumentNullException("key");
this.Key = key;
}
#endregion
#region IKeyedChild<P,K> Members
/// <summary>
/// The key of the child item.
/// </summary>
public K Key
{
get;
protected set;
}
#endregion
}
}