public void Apply(WindowsScriptEngine wse) { foreach (var item in Sources) { var src = new StreamReader(item.Value); if (item.Key.EndsWith(".js")) { wse.Execute(src.ReadToEnd()); } } }
public void Dispose() { Events.Fire("OnDispose"); Dependencies = null; Filename = null; Icons = null; Info = null; ItemTemplates = null; ProjectTemplates = null; Properties = null; _engine = null; }
public void Dispose() { Dependencies = null; Filename = null; Highlightings = null; Icons = null; Info = null; ItemTemplates = null; Language = null; ProjectTemplates = null; Properties = null; _engine = null; }
public static object Wrap(WindowsScriptEngine engine, object obj) { Debug.Assert(!(obj is IScriptMarshalWrapper)); if (obj == null) { return(null); } var expando = obj as IExpando; if ((expando != null) && (obj.GetType().IsCOMObject)) { return(new WindowsScriptItem(engine, expando)); } return(obj); }
public static void Require(WindowsScriptEngine se, Assembly ass) { Type[] types = ass.GetTypes(); foreach (Type type in types) { object[] ca = type.GetCustomAttributes(typeof(ModuleAttribute), false); if (ca != null) { foreach (MethodInfo method in type.GetMethods()) { se.AddHostObject(method.Name, Delegate.CreateDelegate(type, method)); } } else { se.AddHostType(type.Name, type); } } }
public void Apply(WindowsScriptEngine wse, string Language) { foreach (var item in Sources) { var src = new StreamReader(item.Value); if(Language == "JavaScript") { if(item.Key.EndsWith(".js")) { wse.Execute(src.ReadToEnd()); } } else { if (item.Key.EndsWith(".vbs")) { wse.Execute(src.ReadToEnd()); } } } }
public void Apply(WindowsScriptEngine wse, string Language) { foreach (var item in Sources) { var src = new StreamReader(item.Value); if (Language == "JavaScript") { if (item.Key.EndsWith(".js")) { wse.Execute(src.ReadToEnd()); } } else { if (item.Key.EndsWith(".vbs")) { wse.Execute(src.ReadToEnd()); } } } }
public ScriptSite(WindowsScriptEngine engine) { this.engine = engine; }
private WindowsScriptItem(WindowsScriptEngine engine, IExpando target) { this.engine = engine; this.target = target; }
public static object Wrap(WindowsScriptEngine engine, object obj) { Debug.Assert(!(obj is IScriptMarshalWrapper)); if (obj == null) { return null; } var expando = obj as IExpando; if ((expando != null) && (obj.GetType().IsCOMObject)) { return new WindowsScriptItem(engine, expando); } return obj; }
public static void Require(WindowsScriptEngine se, string ass) { Require(se, Assembly.LoadFile(ass)); }