forked from ClearFoundry/ClearScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocumentCategory.cs
More file actions
67 lines (53 loc) · 1.85 KB
/
DocumentCategory.cs
File metadata and controls
67 lines (53 loc) · 1.85 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
namespace Microsoft.ClearScript
{
/// <summary>
/// Represents a document category.
/// </summary>
public abstract class DocumentCategory
{
internal DocumentCategory()
{
MaxCacheSize = 1024;
}
/// <summary>
/// Gets or sets the maximum cache size for the document category.
/// </summary>
/// <remarks>
/// <para>
/// This property specifies the maximum number of prepared or compiled documents of the
/// current category to be cached by script engines. Its initial value is 1024.
/// </para>
/// <para>
/// Each script engine or runtime maintains private caches for supported document
/// categories. These are distinct from the caches used by document loaders.
/// </para>
/// </remarks>
/// <seealso cref="DocumentLoader.MaxCacheSize"/>
public uint MaxCacheSize { get; set; }
/// <summary>
/// Gets the document category for normal scripts.
/// </summary>
public static DocumentCategory Script => ScriptDocument.Instance;
internal abstract string DefaultName { get; }
#region Nested type: ScriptDocument
private sealed class ScriptDocument : DocumentCategory
{
public static readonly ScriptDocument Instance = new ScriptDocument();
private ScriptDocument()
{
}
#region DocumentCategory overrides
internal override string DefaultName => "Script";
#endregion
#region Object overrides
public override string ToString()
{
return "Script";
}
#endregion
}
#endregion
}
}