forked from ClearFoundry/ClearScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocumentSettings.cs
More file actions
79 lines (68 loc) · 2.87 KB
/
DocumentSettings.cs
File metadata and controls
79 lines (68 loc) · 2.87 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.ClearScript.JavaScript;
namespace Microsoft.ClearScript
{
/// <summary>
/// Contains properties that control document access.
/// </summary>
/// <remarks>
/// Additional properties can be defined in derived classes to accommodate custom document accessors.
/// </remarks>
public class DocumentSettings
{
private DocumentLoader loader;
// ReSharper disable EmptyConstructor
/// <summary>
/// Initializes a new <see cref="DocumentSettings"/> instance.
/// </summary>
public DocumentSettings()
{
// the help file builder (SHFB) insists on an empty constructor here
}
// ReSharper restore EmptyConstructor
/// <summary>
/// Gets or sets a document loader.
/// </summary>
public DocumentLoader Loader
{
get { return loader ?? DocumentLoader.Default; }
set { loader = value; }
}
/// <summary>
/// Gets or sets document access options.
/// </summary>
public DocumentAccessFlags AccessFlags { get; set; }
/// <summary>
/// Gets or sets a semicolon-delimited list of directory URLs or paths to search for documents.
/// </summary>
public string SearchPath { get; set; }
/// <summary>
/// Gets or sets a semicolon-delimited list of supported file name extensions.
/// </summary>
public string FileNameExtensions { get; set; }
/// <summary>
/// Gets or set an optional method to be called when a document is loaded.
/// </summary>
public DocumentLoadCallback LoadCallback { get; set; }
/// <summary>
/// Gets or sets an optional document context callback.
/// </summary>
/// <remarks>
/// <para>
/// This property is used as an alternative to <see cref="DocumentInfo.ContextCallback"/>.
/// If specified, the callback is invoked the first time a module attempts to retrieve its
/// context information. The properties it returns are made available to the module
/// implementation. This mechanism can be used to expose host resources selectively,
/// securely, and without polluting the script engine's global namespace.
/// </para>
/// <para>
/// Use
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta">import.meta</see></c>
/// to access the context information of a <see cref="ModuleCategory.Standard"/> JavaScript
/// module. In a <see cref="ModuleCategory.CommonJS"/> module, use <c>module.meta</c>.
/// </para>
/// </remarks>
public DocumentContextCallback ContextCallback { get; set; }
}
}