forked from daveaglick/Scripty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptDirective.cs
More file actions
98 lines (81 loc) · 3.16 KB
/
Copy pathScriptDirective.cs
File metadata and controls
98 lines (81 loc) · 3.16 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
namespace Scripty.Core.Resolvers
{
/// <summary>
/// A script directive
/// </summary>
public class ScriptDirective
{
#region "props and fields"
/// <summary>
/// Gets or sets the type.
/// </summary>
public DirectiveType Type { get; set; }
/// <summary>
/// Gets or sets the resolution target type.
/// </summary>
public ResolutionTargetType ResolutionTargetType { get; set; }
/// <summary>
/// The value of line where the directive appeared
/// </summary>
public string RawValue { get; }
/// <summary>
/// Gets or sets the original reference path.
/// </summary>
public string OriginalReferencePath { get; set; }
/// <summary>
/// The full path of the resolved reference
/// </summary>
public string RewrittenReferencePath { get; private set; }
/// <summary>
/// The full path of calling script.
/// </summary>
public string PathOfCallingScript { get; }
/// <summary>
/// Gets or sets the calling script line number. Zero based
/// </summary>
public int CallingScriptLineNumber { get; set; }
/// <summary>
/// Gets the resolution required.
/// </summary>
public bool RewriteOfReferenceWasNeeded => _rewriteOfReferenceWasNeeded;
private bool _rewriteOfReferenceWasNeeded;
#endregion //#region "props and fields"
#region "ctors"
/// <summary>
/// Initializes a new instance of the <see cref="ScriptDirective"/> class.
/// </summary>
/// <param name="rawValue">The raw value.</param>
/// <param name="pathOfCallingScript">The path of calling script.</param>
/// <param name="callingScriptLineNumber">The calling script line number.</param>
/// <param name="originalReferencePath">The original reference path.</param>
/// <param name="type">The type.</param>
public ScriptDirective(string rawValue, string pathOfCallingScript, int callingScriptLineNumber, string originalReferencePath, DirectiveType type)
{
RawValue = rawValue;
PathOfCallingScript = pathOfCallingScript;
CallingScriptLineNumber = callingScriptLineNumber;
OriginalReferencePath = originalReferencePath;
Type = type;
}
/// <summary>
/// Initializes a new instance of the <see cref="ScriptDirective" /> class.
/// </summary>
/// <param name="rawValue">The raw value.</param>
public ScriptDirective(string rawValue)
{
RawValue = rawValue;
}
#endregion //#region "ctors"
#region "members"
/// <summary>
/// Sets the resolved path.
/// </summary>
/// <param name="resolvedPath">The resolved path.</param>
public void SetRewrittenReferncePath(string resolvedPath)
{
_rewriteOfReferenceWasNeeded = true;
RewrittenReferencePath = resolvedPath;
}
#endregion //#region "members"
}
}