-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathProjectDirectory.cs
More file actions
39 lines (32 loc) · 1013 Bytes
/
Copy pathProjectDirectory.cs
File metadata and controls
39 lines (32 loc) · 1013 Bytes
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
using RPGCore.Packages;
using System.Diagnostics;
namespace RPGCore.Projects;
public class ProjectDirectory : IDirectory
{
public string Name { get; }
public string FullName { get; }
public ProjectDirectoryCollection Directories { get; }
public ProjectResourceCollection Resources { get; }
public IDirectory Parent { get; }
[DebuggerBrowsable(DebuggerBrowsableState.Never)] IDirectoryCollection IDirectory.Directories => Directories;
[DebuggerBrowsable(DebuggerBrowsableState.Never)] IResourceCollection IDirectory.Resources => Resources;
internal ProjectDirectory(ProjectDirectory parent, string name)
{
Parent = parent;
Name = name;
FullName = MakeFullName(parent, name);
Directories = new ProjectDirectoryCollection();
Resources = new ProjectResourceCollection();
}
private static string MakeFullName(IDirectory parent, string key)
{
if (parent == null || string.IsNullOrEmpty(parent.FullName))
{
return key;
}
else
{
return $"{parent.FullName}/{key}";
}
}
}