/// <summary> /// Constructs a new instance of an <see cref="AppScope"/>. /// </summary> /// <param name="name">The unique name for the scope.</param> /// <param name="parent">The parent scope to attach to the scope.</param> /// <param name="context">The execution context that is used to execute scripts.</param> internal SessionScope(string name, AppScope parent, ScriptContext context) : base(name, parent, context, context.GetPrototype("Session")) { // Create a new channel linked to the session this.SessionChannel = new Channel(context); // When creating, set the current thread channel Channel.Current = this.SessionChannel; }
/// <summary> /// Creates a new container that servers as an application container for a scope. /// </summary> /// <param name="prototypeName">The name of the prototype to use.</param> public ConsoleObject(ScriptContext context) : this(context.GetPrototype("Console")) { }
/// <summary> /// Creates a new container that servers as an application container for a scope. /// </summary> /// <param name="prototypeName">The name of the prototype to use.</param> public RemoteObject(ScriptContext context) : this(context.GetPrototype("Remote")) { }
/// <summary> /// Creates a new instance of an object. /// </summary> /// <param name="prototypeName">The name of the prototype to use.</param> public FileObject(ScriptContext context) : this(context.GetPrototype(TypeName)) { }
/// <summary> /// Constructs a new instance of an <see cref="AppScope"/>. /// </summary> /// <param name="application">The owner application.</param> /// <param name="context">The scripting context for this scope.</param> internal AppScope(App application, ScriptContext context) : base("app" + application.Key, null, context, context.GetPrototype("Application")) { context.AttachGlobal("app" + application.Key, this); }
/// <summary> /// Creates a new instance of an object. /// </summary> /// <param name="prototypeName">The name of the prototype to use.</param> /// <param name="param">Either the size of the buffer, a string or the array of octets.</param> /// <param name="encoding">The encoding of a string.</param> public BufferObject(ScriptContext context, BoxedValue param, BoxedValue encoding) : this(context.GetPrototype("Buffer"), param, encoding) { }