43 lines
838 B
C#
43 lines
838 B
C#
using System;
|
|
using System.Security.Permissions;
|
|
|
|
namespace AspClassic.Scripting.Hosting;
|
|
|
|
public class ScriptHost : MarshalByRefObject
|
|
{
|
|
private ScriptRuntime _runtime;
|
|
|
|
public ScriptRuntime Runtime
|
|
{
|
|
get
|
|
{
|
|
if (_runtime == null)
|
|
{
|
|
throw new InvalidOperationException("Host not initialized");
|
|
}
|
|
return _runtime;
|
|
}
|
|
}
|
|
|
|
public virtual PlatformAdaptationLayer PlatformAdaptationLayer => PlatformAdaptationLayer.Default;
|
|
|
|
internal void SetRuntime(ScriptRuntime runtime)
|
|
{
|
|
_runtime = runtime;
|
|
RuntimeAttached();
|
|
}
|
|
|
|
protected virtual void RuntimeAttached()
|
|
{
|
|
}
|
|
|
|
protected internal virtual void EngineCreated(ScriptEngine engine)
|
|
{
|
|
}
|
|
|
|
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
|
|
public override object InitializeLifetimeService()
|
|
{
|
|
return null;
|
|
}
|
|
}
|