-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathProjectResourceDependency.cs
More file actions
44 lines (35 loc) · 1 KB
/
Copy pathProjectResourceDependency.cs
File metadata and controls
44 lines (35 loc) · 1 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
using RPGCore.Packages;
using System.Collections.Generic;
using System.Diagnostics;
namespace RPGCore.Projects;
public sealed class ProjectResourceDependency : IResourceDependency
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly ProjectExplorer projectExplorer;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
internal readonly Dictionary<string, string> metdadata;
public IReadOnlyDictionary<string, string> Metadata => metdadata;
public string Key { get; }
public bool IsValid => projectExplorer.Resources.Contains(Key);
public ProjectResource Resource
{
get
{
try
{
return projectExplorer.Resources[Key];
}
catch
{
return null;
}
}
}
[DebuggerBrowsable(DebuggerBrowsableState.Never)] IResource IResourceDependency.Resource => Resource;
internal ProjectResourceDependency(ProjectExplorer projectExplorer, string key, Dictionary<string, string> metdadata)
{
this.projectExplorer = projectExplorer;
this.metdadata = metdadata;
Key = key;
}
}