Beispiel #1
0
 private static async Task RunMainAsync(ScriptSettupInfo settupInfo)
 {
     while (!settupInfo.IsCancelRunning)
     {
         await Task.Delay(1000);
     }
 }
Beispiel #2
0
        private ScriptRuntimeScope CreateRuntimeScope(ScriptSettupInfo settupInfo, string amsKey, Type type)
        {
#if STATIC
            return(type.CreateInstance <ScriptRuntimeScope>(settupInfo));
#else
            return(_context.GetInstance(amsKey, type.FullName, settupInfo) as ScriptRuntimeScope);
#endif
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        public ScriptRuntimeScope CreateScope(ScriptSettupInfo settupInfo)
        {
            var    type   = typeof(ScriptRuntimeScope);
            string amsKey = type.Assembly.GetName().Name;

            _scope = _context.GetInstance(amsKey, type.FullName, settupInfo) as ScriptRuntimeScope;
            if (_scope != null)
            {
                _scope.Init();
            }
            return(_scope);
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        public ScriptRuntimeScope CreateScope(ScriptSettupInfo settupInfo)
        {
            var    type   = typeof(ScriptRuntimeScope);
            string amsKey = type.Assembly.GetName().Name;

            _scope = CreateRuntimeScope(settupInfo, amsKey, type);
            if (_scope != null)
            {
                _scope.Init();
            }
            return(_scope);
        }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 public ScriptRuntimeScope CreateScope(ScriptSettupInfo settupInfo)
 {
     try
     {
         var    type   = typeof(ScriptRuntimeScope);
         string amsKey = type.Assembly.GetName().Name;
         _scope = _context.GetInstance(amsKey, type.FullName, settupInfo) as ScriptRuntimeScope;
         if (_scope != null)
         {
             _scope.Init();
         }
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("Script runtime create scope error:{0}", ex);
     }
     return(_scope);
 }
Beispiel #6
0
 /// <summary>
 /// 
 /// </summary>
 public ScriptRuntimeScope CreateScope(ScriptSettupInfo settupInfo)
 {
     try
     {
         var type = typeof(ScriptRuntimeScope);
         string amsKey = type.Assembly.GetName().Name;
         _scope = _context.GetInstance(amsKey, type.FullName, settupInfo) as ScriptRuntimeScope;
         if (_scope != null)
         {
             _scope.Init();
         }
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("Script runtime create scope error:{0}", ex);
     }
     return _scope;
 }
Beispiel #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="settupInfo"></param>
 public PythonRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
     _pythonCodeCache = new DictionaryExtend <string, PythonFileInfo>();
 }
Beispiel #8
0
 static ScriptEngines()
 {
     _settupInfo   = new ScriptSettupInfo();
     _changedFiles = new HashSet <string>();
 }
Beispiel #9
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="settupInfo"></param>
 public CSharpRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
 }
Beispiel #10
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="settupInfo"></param>
 public PythonRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
 }
Beispiel #11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="settupInfo"></param>
 public PythonRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
     _pythonCodeCache = new DictionaryExtend<string, PythonFileInfo>();
 }
 /// <summary>
 /// init
 /// </summary>
 /// <param name="settupInfo"></param>
 protected ScriptBaseScope(ScriptSettupInfo settupInfo)
 {
     SettupInfo = settupInfo;
     WatcherPathList = new List<string>();
     _rootPathArr = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath).Split('\\', '/', '.');
 }
Beispiel #13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="settupInfo"></param>
 public CSharpRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
     _modelCodeCache = new DictionaryExtend<string, ScriptFileInfo>();
     _csharpCodeCache = new DictionaryExtend<string, ScriptFileInfo>();
 }
Beispiel #14
0
 /// <summary>
 /// 
 /// </summary>
 public ScriptRuntimeScope CreateScope(ScriptSettupInfo settupInfo)
 {
     var type = typeof(ScriptRuntimeScope);
     string amsKey = type.Assembly.GetName().Name;
     _scope = _context.GetInstance(amsKey, type.FullName, settupInfo) as ScriptRuntimeScope;
     if (_scope != null)
     {
         _scope.Init();
     }
     return _scope;
 }
Beispiel #15
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="settupInfo"></param>
 public LuaRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
 }
Beispiel #16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="settupInfo"></param>
 public PythonRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
 }
Beispiel #17
0
 /// <summary>
 /// 
 /// </summary>
 public ScriptRuntimeScope CreateScope(ScriptSettupInfo settupInfo)
 {
     var type = typeof(ScriptRuntimeScope);
     string amsKey = type.Assembly.GetName().Name;
     _scope = CreateRuntimeScope(settupInfo, amsKey, type);
     if (_scope != null)
     {
         _scope.Init();
     }
     return _scope;
 }
Beispiel #18
0
        private ScriptRuntimeScope CreateRuntimeScope(ScriptSettupInfo settupInfo, string amsKey, Type type)
        {
#if STATIC
            return type.CreateInstance<ScriptRuntimeScope>(settupInfo);
#else
            return _context.GetInstance(amsKey, type.FullName, settupInfo) as ScriptRuntimeScope;
#endif
        }
 /// <summary>
 /// init
 /// </summary>
 /// <param name="settupInfo"></param>
 protected ScriptBaseScope(ScriptSettupInfo settupInfo)
 {
     SettupInfo      = settupInfo;
     WatcherPathList = new List <string>();
     _rootPathArr    = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath).Split('\\', '/', '.');
 }
Beispiel #20
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="settupInfo"></param>
 public CSharpRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
 }
Beispiel #21
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="settupInfo"></param>
 public CSharpRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
     _modelCodeCache  = new DictionaryExtend <string, ScriptFileInfo>();
     _csharpCodeCache = new DictionaryExtend <string, ScriptFileInfo>();
 }
Beispiel #22
0
 static ScriptEngines()
 {
     _settupInfo = new ScriptSettupInfo();
     _changedFiles = new HashSet<string>();
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="settupInfo"></param>
 public LuaRuntimeScope(ScriptSettupInfo settupInfo)
     : base(settupInfo)
 {
 }