Пример #1
0
        private IDataStreamParser CreateConverter()
        {
            if (_convert == null)
            {
                ScriptContainer container = new ScriptContainer(_engine, Guid.Empty, _script, _enableDebug, _referencedAssemblies.Select(a => a.GetName()));
                _convert = (IDataStreamParser)ScriptUtils.GetInstance(container, _classname);
                if (_state != null)
                {
                    IPersistDynamicNode persist = _convert as IPersistDynamicNode;
                    if (persist != null)
                    {
                        persist.SetState(_state, GetLogger());
                    }
                }
            }

            return(_convert);
        }
Пример #2
0
 /// <summary>
 /// Get an instance of a class from the script
 /// </summary>
 /// <param name="classname">The classname to get</param>
 /// <param name="args">The arguments for the constructor</param>
 /// <returns>An instance of the object</returns>
 public object GetInstance(string classname, params object[] args)
 {
     return(ScriptUtils.GetInstance(this, classname, args));
 }
Пример #3
0
 /// <summary>
 /// Get an instance of a class from the script using internal classname
 /// </summary>
 /// <param name="args">The arguments for the constructor</param>
 /// <returns>An instance of the object</returns>
 public object GetInstance(params object[] args)
 {
     return(ScriptUtils.GetInstance(_container, _classname, args));
 }
Пример #4
0
 /// <summary>
 /// Get an instance of a class from the script
 /// </summary>
 /// <param name="classname">The classname to get</param>
 /// <returns>An instance of the object</returns>
 public object GetInstance(string classname)
 {
     return(ScriptUtils.GetInstance(this, classname));
 }
Пример #5
0
 /// <summary>
 /// Get an instance of a class from the script using internal classname
 /// </summary>
 /// <returns>An instance of the object</returns>
 public object GetInstance()
 {
     return(ScriptUtils.GetInstance(_container, _classname));
 }