-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathEditorKeyValuePair.cs
More file actions
61 lines (48 loc) · 1.75 KB
/
Copy pathEditorKeyValuePair.cs
File metadata and controls
61 lines (48 loc) · 1.75 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
57
58
59
60
61
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
namespace RPGCore.DataEditor;
/// <summary>
/// An editable hard-typed key-value pair belonging to a dictionary.
/// </summary>
public class EditorKeyValuePair : IEditorToken
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly List<string> comments;
/// <inheritdoc/>
public IList<string> Comments => comments;
/// <inheritdoc/>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public EditorSession Session => Parent.Session;
/// <summary>
/// The <see cref="EditorDictionary"/> that this <see cref="EditorKeyValuePair"/> belongs to.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public EditorDictionary Parent { get; }
/// <summary>
/// Gets the key in the key/value pair.
/// </summary>
public EditorReplaceable Key { get; }
/// <summary>
/// Gets the value in the key/value pair.
/// </summary>
public EditorReplaceable Value { get; }
/// <summary>
/// A collection of <see cref="IEditorFeature"/>s associated with this <see cref="EditorKeyValuePair"/>.
/// </summary>
public FeatureCollection<EditorKeyValuePair> Features { get; }
/// <inheritdoc/>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
FeatureCollection IEditorToken.Features => Features;
/// <inheritdoc/>
public event PropertyChangedEventHandler PropertyChanged;
internal EditorKeyValuePair(EditorDictionary parent, IEditorValue key, IEditorValue value)
{
Parent = parent;
Key = new EditorReplaceable(parent.Session, parent.KeyType, key);
Value = new EditorReplaceable(parent.Session, parent.ValueType, value);
Features = new FeatureCollection<EditorKeyValuePair>(this);
comments = new List<string>();
PropertyChanged = delegate { };
}
}