Beispiel #1
0
        private IProcessingStep GetIProcessingStep()
        {
            if (processingStep == null)
            {
                string processingType = ConfigurationManager.AppSettings["IProcessingStep"];
                if (!string.IsNullOrEmpty(processingType) && processingType.Split(';').Length == 2)
                {
                    string assemblyName = processingType.Split(';')[0];
                    string typeName     = processingType.Split(';')[1];

                    if (assemblyName.ToLower().EndsWith(".dll"))
                    {
                        assemblyName = string.Join(".", assemblyName.Split('.').Reverse().Skip(1).Reverse());
                    }

                    var obj = Activator.CreateInstance(assemblyName, typeName).Unwrap();
                    if (obj is IProcessingStep)
                    {
                        processingStep = obj as IProcessingStep;
                    }
                }
            }

            if (processingStep != null)
            {
                return(processingStep);
            }
            else
            {
                throw new Exception("Could Not Create IProcessingStep from AppSettings");
            }
        }
        public FluTeCorePrototype AttachProcessingStep(string token, IProcessingStep step)
        {
            var key = new TokenKey(token, TokenType.Injection);

            if (!Tokens.ContainsKey(key))
            {
                throw new KeyNotFoundException("Could not find an injection token with the specified name.");
            }
            else
            {
                var tok = (IUnresolvedToken)Tokens[key];
                tok = tok.AttachStep(step);
                return(new FluTeCorePrototype(Tokens.Set(key, tok), TokenSequence, Inputs, PostProcessingQueue));
            }
        }
Beispiel #3
0
            protected override void OnIntercept(IInvocation invocation, IProcessingStep processingStep, Command cmd)
            {
                _logger.Debug("for cmd: - begin");

                bool exceptionThrown = false;

                try {
                    invocation.Proceed();
                } catch {
                    exceptionThrown = true;
                    throw;
                } finally {
                    _logger.Debug("for cmd: - end  times");
                }
            }
Beispiel #4
0
        // ReSharper disable LoopCanBeConvertedToQuery
        private IAstElement Process(IAstElement element, ProcessingContext context, IProcessingStep[] steps)
        {
            foreach (var step in steps) {
                element = step.ProcessBeforeChildren(element, context);
            }

            context.ElementStack.Push(element);
            element.TransformChildren(c => Process(c, context, steps));
            context.ElementStack.Pop();

            foreach (var step in steps) {
                element = step.ProcessAfterChildren(element, context);
            }

            return element;
        }
Beispiel #5
0
        private IProcessingStep GetIProcessingStep()
        {
            if (processingStep == null)
            {
                string processingType = ConfigurationManager.AppSettings["IProcessingStep"];
                if (!string.IsNullOrEmpty(processingType) && processingType.Split(';').Length == 2)
                {
                    string assemblyName = processingType.Split(';')[0];
                    string typeName = processingType.Split(';')[1];

                    if (assemblyName.ToLower().EndsWith(".dll"))
                        assemblyName = string.Join(".", assemblyName.Split('.').Reverse().Skip(1).Reverse());

                    var obj = Activator.CreateInstance(assemblyName, typeName).Unwrap();
                    if (obj is IProcessingStep)
                        processingStep = obj as IProcessingStep;
                }
            }

            if (processingStep != null)
                return processingStep;
            else
                throw new Exception("Could Not Create IProcessingStep from AppSettings");
        }
Beispiel #6
0
 protected abstract void OnIntercept(IInvocation invocation, IProcessingStep processingStep, Command cmd);
 public FluTeCorePrototype AttachPostProcessingStep(IProcessingStep step)
 {
     return(new FluTeCorePrototype(Tokens, TokenSequence, Inputs, PostProcessingQueue.Extend(step)));
 }
Beispiel #8
0
 public ProcessingStep(IProcessingStep processingStep)
 {
     Name = processingStep.GetType().Name;
     Type = processingStep.GetType().FullName;
     parameters = new List<ProcessingParameter>();
 }
Beispiel #9
0
 IForClause <TNew> IForClause.Attach <TNew>(IProcessingStep <object, TNew> step)
 {
     return(new TokenForClause <TNew>(inner.innerTemplate.AttachProcessingStep(token, step).Convert(), token));
 }
Beispiel #10
0
 IForClause <TNew> IForClause.Attach <TNew>(IProcessingStep <object, TNew> step)
 {
     return(new TemplateFinallyClause <TNew>(innerNext.innerTemplate.AttachPostProcessingStep(step).Convert()));
 }
Beispiel #11
0
 public IUnresolvedToken AttachStep(IProcessingStep step)
 {
     return(new UnresolvedToken(Key, Inputs, Processing.Extend(step)));
 }
Beispiel #12
0
 /// <summary>
 ///   Extends the processing queue with the specified processing step.
 /// </summary>
 /// <param name = "step"></param>
 /// <returns></returns>
 public ProcessingQueue Extend(IProcessingStep step)
 {
     return(new ProcessingQueue(steps.ConsLast(step)));
 }
Beispiel #13
0
 public LightProcessor(INameSource[] topLevelNameSources, IProcessingStep[] steps)
 {
     this.topLevelNameSources = topLevelNameSources;
     this.steps = steps.OrderBy(s => s.Stage).ToArray();
 }