Boo.Lang.Compiler.CompilerPipeline.Add C# (CSharp) Метод

Add() публичный Метод

public Add ( ICompilerStep step ) : CompilerPipeline
step ICompilerStep
Результат CompilerPipeline
        public CompilerPipeline Add(ICompilerStep step)
        {
            if (null == step) throw new ArgumentNullException("step");
            _items.Add(step);
            return this;
        }

Usage Example

Пример #1
0
		public void CurrentStep()
		{
			var pipeline = new CompilerPipeline();

			var step1 = new ActionStep(delegate {});
			pipeline.Add(step1);

			ActionStep step2 = null;
			step2 = new ActionStep(() => Assert.AreSame(step2, pipeline.CurrentStep));
			pipeline.Add(step2);

			var currentSteps = new Boo.Lang.List();
			pipeline.Before += (sender, args) => currentSteps.Add(pipeline.CurrentStep);
			pipeline.BeforeStep += (sender, args) => currentSteps.Add(pipeline.CurrentStep);
			pipeline.AfterStep += (sender, args) => currentSteps.Add(pipeline.CurrentStep);
			pipeline.After += (sender, args) => currentSteps.Add(pipeline.CurrentStep);

			pipeline.Run(new CompilerContext());

			Assert.AreEqual(
				new object[] { null, step1, step1, step2, step2, null },
				currentSteps.ToArray());
		}
All Usage Examples Of Boo.Lang.Compiler.CompilerPipeline::Add