本文整理汇总了C#中ScriptContext.GetPrototype方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptContext.GetPrototype方法的具体用法?C# ScriptContext.GetPrototype怎么用?C# ScriptContext.GetPrototype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptContext
的用法示例。
在下文中一共展示了ScriptContext.GetPrototype方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SessionScope
/// <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;
}
示例2: ConsoleObject
/// <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"))
{
}
示例3: RemoteObject
/// <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"))
{
}
示例4: FileObject
/// <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))
{
}
示例5: AppScope
/// <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);
}
示例6: BufferObject
/// <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)
{
}