internal virtual void OnScriptCustomEvent(ISchedulerTaskScript script, object input)
 {
     if (ScriptCustomEvent != null)
     {
         ScriptCustomEvent(this, script, input);
     }
 }
        protected SchedulerTaskScriptDependencies ResolveScriptDependency(ISchedulerTaskScript script, IComponentContext context)
        {
            if (script.DependencyClassType == null || script.DependencyClassType == typeof(void))
            {
                //TODO: return some default dependency
                return(null);
            }

            var result = context.ResolveOptional(script.DependencyClassType) as SchedulerTaskScriptDependencies;

            //creating instance manually
            if (result == null)
            {
                result = Activator.CreateInstance(script.DependencyClassType)
                         as SchedulerTaskScriptDependencies;
                if (result == null)
                {
                    throw new Exception("Script Dependency can not be resolved. Check the dependency type");
                }
                context.InjectProperties(result);
            }

            if (result == null)
            {
                throw new Exception("Script Dependency can not be resolved");
            }
            return(result);
        }
 protected virtual void OnScriptFinished(ISchedulerTaskScript script)
 {
     if (ScriptFinished != null)
     {
         ScriptFinished(this, script);
     }
 }
示例#4
0
 protected virtual void OnScriptStarted(SchedulerTask task, ISchedulerTaskScript script)
 {
     if (ScriptStarted != null)
     {
         ScriptStarted(task, script);
     }
 }
示例#5
0
 protected void OnScriptCustomEvent(SchedulerTask task, ISchedulerTaskScript script, object input)
 {
     if (ScriptCustomEvent != null)
     {
         ScriptCustomEvent(task, script, input);
     }
 }
示例#6
0
        public SchedulerTaskScriptDependencies TestDependency(ISchedulerTaskScript script, IComponentContext context)
        {
            var dep = ResolveScriptDependency(script, context);

            ValidateDependencies(dep);
            return(dep);
        }
 internal virtual void OnScriptCustomEvent(ISchedulerTaskScript script, object input)
 {
     if (ScriptCustomEvent != null) ScriptCustomEvent(this, script, input);
 }
 protected virtual void OnScriptFinished(ISchedulerTaskScript script)
 {
     if (ScriptFinished != null) ScriptFinished(this, script);
 }
        protected SchedulerTaskScriptDependencies ResolveScriptDependency(ISchedulerTaskScript script, IComponentContext context)
        {
            if (script.DependencyClassType == null || script.DependencyClassType == typeof(void))
            {
                //TODO: return some default dependency
                return null;
            }

            var result = context.ResolveOptional(script.DependencyClassType) as SchedulerTaskScriptDependencies;

            //creating instance manually
            if (result == null)
            {
                result = Activator.CreateInstance(script.DependencyClassType)
                         as SchedulerTaskScriptDependencies;
                if (result == null) throw new Exception("Script Dependency can not be resolved. Check the dependency type");
                context.InjectProperties(result);
            }

            if(result==null) throw new Exception("Script Dependency can not be resolved");
            return result;
        }
 public SchedulerTaskScriptDependencies TestDependency(ISchedulerTaskScript script, IComponentContext context)
 {
     var dep = ResolveScriptDependency(script, context);
     ValidateDependencies(dep);
     return dep;
 }
 protected virtual void OnScriptStarted(SchedulerTask task, ISchedulerTaskScript script)
 {
     if (ScriptStarted != null) ScriptStarted(task, script);
 }
 protected void OnScriptCustomEvent(SchedulerTask task, ISchedulerTaskScript script, object input)
 {
     if (ScriptCustomEvent != null) ScriptCustomEvent(task, script, input);
 }