progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
43
AspClassic.Scripting/Hosting/ScriptHost.cs
Normal file
43
AspClassic.Scripting/Hosting/ScriptHost.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue