Beispiel #1
0
        IScript createScript()
        {
            var _script = ObjectFactory <ScriptType, IScript> .Create(script.ScriptType, new object[] { script, session, callStatistics });

            if (_script == null)                        // not in cache
            {
                var _typeName = string.Format("Timok.IVR.Scripting.{0}CallScript", script.ScriptType);

                var _type = Assembly.GetCallingAssembly().GetType(_typeName);
                if (_type == null)
                {
                    TimokLogger.Instance.LogRbr(LogSeverity.Error, "ScriptFactory.createinstance", string.Format("Error creating type={0}", _typeName));
                    return(null);
                }

                ObjectFactory <ScriptType, ISessionHandler> .Add(script.ScriptType, _type);

                _script = ObjectFactory <ScriptType, IScript> .Create(script.ScriptType, new object[] { script, session });
            }

            return(_script);
        }