Esempio n. 1
0
 public static bool IsValidName(string name)
 {
     if (GetScriptFilePath(name) != null)
     {
         return(true);
     }
     return(ScriptBinder.IsFunctionName(name));
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public string Complete(string prefix)
        {
            string postfix = null;

            if (ShellEngine != null)
            {
                postfix = ShellEngine.Complete(prefix);
            }
            if (postfix == null)
            {
                postfix = ScriptBinder.Complete(prefix);
            }
            return(postfix);
        }
Esempio n. 4
0
 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();
 }