Пример #1
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
        }
Пример #2
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);
        }
Пример #3
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);
 }