public static bool IsValidName(string name) { if (GetScriptFilePath(name) != null) { return(true); } return(ScriptBinder.IsFunctionName(name)); }
public static ScriptEngine Create(Shell shell) { ScriptEngine se = new ScriptEngine(shell, Options.Ecmascript5 /* | Options.Strict */); ScriptBinder.RegisterScriptElements(se); se.IsPaused = false; se.EngineThread.Start(); se.SchedulerThread.Start(); se.BreakThread.Start(); return(se); }
public string Complete(string prefix) { string postfix = null; if (ShellEngine != null) { postfix = ShellEngine.Complete(prefix); } if (postfix == null) { postfix = ScriptBinder.Complete(prefix); } return(postfix); }
internal static void UpdateInstalledModules() { foreach (Module m in ModuleAddIns) { if (!m.Installed && m.IsAuthenticated()) { m.Installed = true; Assembly a = m.GetType().Assembly; if (a == null) { continue; } Type[] types = a.GetExportedTypes(); foreach (Type t in types) { ScriptBinder.ScanTypeForScriptElements(t); Shell.ScanTypeForShellDeserializers(t); } } } Scripts.UpdateScriptCache(); }