forked from Taritsyn/MsieJavaScriptEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIInnerJsEngine.cs
More file actions
90 lines (78 loc) · 2.8 KB
/
Copy pathIInnerJsEngine.cs
File metadata and controls
90 lines (78 loc) · 2.8 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
using System;
namespace MsieJavaScriptEngine
{
/// <summary>
/// Interface for the inner JS engine
/// </summary>
internal interface IInnerJsEngine : IDisposable
{
/// <summary>
/// Gets a name of JS engine mode
/// </summary>
string Mode { get; }
/// <summary>
/// Evaluates an expression
/// </summary>
/// <param name="expression">JS expression</param>
/// <param name="documentName">Document name</param>
/// <returns>Result of the expression</returns>
object Evaluate(string expression, string documentName);
/// <summary>
/// Executes a code
/// </summary>
/// <param name="code">JS code</param>
/// <param name="documentName">Document name</param>
void Execute(string code, string documentName);
/// <summary>
/// Calls a function
/// </summary>
/// <param name="functionName">Function name</param>
/// <param name="args">Function arguments</param>
/// <returns>Result of the function execution</returns>
object CallFunction(string functionName, params object[] args);
/// <summary>
/// Сhecks for the existence of a variable
/// </summary>
/// <param name="variableName">Name of variable</param>
/// <returns>Result of check (true - exists; false - not exists</returns>
bool HasVariable(string variableName);
/// <summary>
/// Gets a value of variable
/// </summary>
/// <param name="variableName">Name of variable</param>
/// <returns>Value of variable</returns>
object GetVariableValue(string variableName);
/// <summary>
/// Sets a value of variable
/// </summary>
/// <param name="variableName">Name of variable</param>
/// <param name="value">Value of variable</param>
void SetVariableValue(string variableName, object value);
/// <summary>
/// Removes a variable
/// </summary>
/// <param name="variableName">Name of variable</param>
void RemoveVariable(string variableName);
/// <summary>
/// Embeds a host object to script code
/// </summary>
/// <param name="itemName">The name for the new global variable or function that will represent the object</param>
/// <param name="value">The object to expose</param>
/// <remarks>Allows to embed instances of simple classes (or structures) and delegates.</remarks>
void EmbedHostObject(string itemName, object value);
/// <summary>
/// Embeds a host type to script code
/// </summary>
/// <param name="itemName">The name for the new global variable that will represent the type</param>
/// <param name="type">The type to expose</param>
/// <remarks>
/// Host types are exposed to script code in the form of objects whose properties and
/// methods are bound to the type's static members.
/// </remarks>
void EmbedHostType(string itemName, Type type);
/// <summary>
/// Performs a full garbage collection
/// </summary>
void CollectGarbage();
}
}