private static void Register(Type type) { //Log.WriteLine("Registering {0} as script", type.Name); try { var ctor = type.GetConstructor(new Type[] { }); if (ctor == null) { throw new Exception("Constructor not found"); } var script = (Script)ctor.Invoke(new object[] { }); if (script == null) { throw new Exception("Unable to instantiate script"); } ScriptPool.AddLast(script); } catch (Exception ex) { Log.WriteLine("Failed to compile: {0}", ex.Message); } }
public GlobTimerEvent(ScriptPool scriptPool) : base(995) { this._ScriptPool = scriptPool; }