Example #1
0
 public GeneratorInfo(ISetup setup, ModelCache modelCache, IGeneratorSetup generatorSetup, IGenerator <ISetup, IGeneratorSetup, ITarget, object, IRun, object> generator)
 {
     this.Setup          = setup;
     this.ModelCache     = modelCache;
     this.GeneratorSetup = generatorSetup;
     this.Generator      = generator;
 }
Example #2
0
 public GeneratorRun(ISetup setup, IGeneratorSetup generatorSetup, IGenerator <ISetup, IGeneratorSetup, ITarget, object, IRun, object> generator, ITarget target, IModelInfo <object> modelInfo, IReadOnlyList <IRun> runs)
 {
     this.Setup          = setup;
     this.GeneratorSetup = generatorSetup;
     this.Generator      = generator;
     this.Target         = target;
     this.ModelInfo      = modelInfo;
     this.Runs           = runs;
     this.Outputs        = new object[this.Runs.Count];
 }
Example #3
0
        private static GeneratorInfo CreateGeneratorInfo(
            SetupInfo setupInfo,
            ModelCache modelCache,
            IGeneratorSetup generatorSetup,
            int generatorSetupIndex,
            IGenerator?previousGenerator)
        {
            var generator = GeneratorFactory.CreateGenerator(generatorSetup.Generator, setupInfo, generatorSetupIndex, previousGenerator);

            return(new GeneratorInfo(setupInfo.Setup, modelCache, generatorSetup, generator));
        }
 /// <summary>
 /// Generates a string based on the specified parameters.
 /// </summary>
 /// <param name="setup">The setup.</param>
 /// <param name="generatorSetup">The generator setup.</param>
 /// <param name="target">The target information.</param>
 /// <param name="model">The model.</param>
 /// <param name="run">The run information.</param>
 /// <param name="index">The index.</param>
 /// <returns>
 /// The generated string.
 /// </returns>
 public object Generate(ISetup setup, IGeneratorSetup generatorSetup, ITarget target, object model, IRun run, long index)
 {
     return(this.generator.Generate((TSetup)setup, (TGeneratorSetup)generatorSetup, (TTarget)target, (TModel)model, (TRun)run, index) ?? throw new InvalidOperationException($"Generator: {this.generator} returned null."));
 }
 /// <summary>
 /// Prepares the specified setup.
 /// </summary>
 /// <param name="setup">The setup.</param>
 /// <param name="generatorSetup">The generator setup.</param>
 /// <param name="target">The target.</param>
 /// <param name="model">The model.</param>
 /// <param name="modelOrigin">The model path.</param>
 /// <returns>
 /// A list of <see cref="IRun" />s.
 /// </returns>
 public IReadOnlyList <IRun> Prepare(ISetup setup, IGeneratorSetup generatorSetup, ITarget target, object model, string modelOrigin)
 {
     return((IReadOnlyList <IRun>) this.generator.Prepare((TSetup)setup, (TGeneratorSetup)generatorSetup, (TTarget)target, (TModel)model, modelOrigin));
 }