forked from RickStrahl/Westwind.Scripting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptFileContext.cs
More file actions
60 lines (49 loc) · 1.66 KB
/
Copy pathScriptFileContext.cs
File metadata and controls
60 lines (49 loc) · 1.66 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
using System.Collections.Generic;
namespace Westwind.Scripting;
/// <summary>
/// Context object used for File based script parsing. The main purpose
/// of this context is to pass data through so that Layout and Sections
/// and partials can be processed reliably.
/// </summary>
public class ScriptFileContext
{
public ScriptFileContext(string scriptText, string basePath = null )
{
Script = scriptText;
BasePath = basePath;
}
/// <summary>
/// The base path used for / and ~/ resolution
/// If not specified the document's path (for files)
/// or the current directory (for strings) is used
/// </summary>
public string BasePath { get; set; }
/// <summary>
/// The actual script code that's passed and updated
/// through out the request processing process
/// </summary>
public string Script { get; set; }
/// <summary>
/// The model that will be passed to the execution code
/// </summary>
public object Model { get; set; }
/// <summary>
/// The layout page if any to use for this script. Path is relative
/// the detail page.
///
/// Provided so compilation works not used in code.
/// </summary>
public string Layout { get; set; }
/// <summary>
/// The title of the page
/// </summary>
public string Title { get; set; }
/// <summary>
/// Dictionary of sections that are captured and passed through
/// </summary>
internal Dictionary<string, string> Sections { get; set; } = new();
/// <summary>
/// The top level script that is being processing
/// </summary>
public string ScriptFile { get; set; }
}