public override bool IsUnblockedMethod(HostItem hostItem) { return(false); }
public override bool IsUnblockedMethod(HostItem hostItem) { return(!method.IsBlockedFromScript(hostItem.DefaultAccess)); }
public override bool IsPreferredMethod(HostItem hostItem, string name) { return(false); }
public abstract bool IsUnblockedMethod(HostItem hostItem);
public override bool IsPreferredMethod(HostItem hostItem, string name) { return false; }
/// <summary> /// Converts an object to a host object with the specified type restriction, for use with /// script code running in the specified script engine. /// </summary> /// <typeparam name="T">The type whose members are to be made accessible from script code.</typeparam> /// <param name="target">The object to convert to a host object for use with script code.</param> /// <param name="engine">The script engine in which the host object will be used.</param> /// <returns>A host object with the specified type restriction.</returns> public static object ToRestrictedHostObject <T>(this T target, ScriptEngine engine) { MiscHelpers.VerifyNonNullArgument(target, "target"); MiscHelpers.VerifyNonNullArgument(engine, "engine"); return(HostItem.Wrap(engine, target, typeof(T))); }
public HostIndexedProperty(HostItem target, string name) { this.target = target; this.name = name; }
public override bool IsPreferredMethod(HostItem hostItem, string name) { return !method.IsBlockedFromScript(hostItem.DefaultAccess) && (method.GetScriptName() == name); }
public override bool IsUnblockedMethod(HostItem hostItem) { return !method.IsBlockedFromScript(hostItem.DefaultAccess); }
public override object Invoke(HostItem hostItem) { if (method == getTypeMethod) { hostItem.Engine.CheckReflection(); } return InvokeHelpers.InvokeMethod(hostItem, hostTarget.InvokeTarget, method, args); }
public abstract bool IsPreferredMethod(HostItem hostItem, string name);
public abstract object Invoke(HostItem hostItem);
public override bool IsUnblockedMethod(HostItem hostItem) { return false; }
public override object Invoke(HostItem hostItem) { throw exceptionFactory(); }
/// <summary> /// Converts a type to a host type for use with script code running in the specified /// script engine. /// </summary> /// <param name="type">The type to convert to a host type.</param> /// <param name="engine">The script engine in which the host type will be used.</param> /// <returns>A host type for use with script code.</returns> public static object ToHostType(this Type type, ScriptEngine engine) { MiscHelpers.VerifyNonNullArgument(type, "type"); MiscHelpers.VerifyNonNullArgument(engine, "engine"); return(HostItem.Wrap(engine, HostType.Wrap(type))); }
public HostMethod(HostItem target, string name) { this.target = target; this.name = name; }
/// <summary> /// Exposes a host object to script code with the specified type restriction and options. /// </summary> /// <typeparam name="T">The type whose members are to be made accessible from script code.</typeparam> /// <param name="itemName">A name for the new global script item that will represent the object.</param> /// <param name="flags">A value that selects options for the operation.</param> /// <param name="target">The object to expose.</param> /// <remarks> /// This method can be used to restrict script access to the members of a particular /// interface or base class. /// <para> /// For information about the mapping between host members and script-callable properties /// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>. /// </para> /// </remarks> public void AddRestrictedHostObject <T>(string itemName, HostItemFlags flags, T target) { AddHostItem(itemName, flags, HostItem.Wrap(this, target, typeof(T))); }
public override bool IsPreferredMethod(HostItem hostItem, string name) { return(!method.IsBlockedFromScript(hostItem.DefaultAccess) && (method.GetScriptName() == name)); }