Beispiel #1
0
        /// <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;
        }
Beispiel #2
0
 /// <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"))
 {
 }
Beispiel #3
0
 /// <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"))
 {
 }
Beispiel #4
0
 /// <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))
 {
 }
Beispiel #5
0
 /// <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);
 }
Beispiel #6
0
 /// <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)
 {
 }