Beispiel #1
0
 /// <summary>
 /// Creates a configuration exception with a helpful message.
 /// </summary>
 /// <param name="step">The generation step that the misconfigured parameter was encountered in.</param>
 /// <param name="parameterName">The name of the misconfigured parameter.</param>
 /// <param name="message">A message explaining the requirements for the parameter's value.</param>
 public InvalidConfigurationException(GenerationStep step, string parameterName, string message)
     : base("Invalid configuration encountered for generation step parameter:\n" +
            $"    Generation Step: ${step.GetType().Name} (name: {step.Name})\n" +
            $"    Parameter Name : ${parameterName}\n" +
            $"    Message        : ${message}")
 {
     ParameterName = parameterName;
     Step          = step;
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new exception with a helpful error message.
 /// </summary>
 /// <param name="step">Generation step that failed to find its required components.</param>
 /// <param name="requiredComponentType">Type of the required component that was not found.</param>
 /// <param name="requiredComponentTag">Tag of the required component that was not found, or null if no tag was required.</param>
 public MissingContextComponentException(GenerationStep step, Type requiredComponentType,
                                         string?requiredComponentTag)
     : base("Generation step was performed on a context that did not have the required components:\n" +
            $"    Generation Step   : {step.GetType().Name} (name: {step.Name})\n" +
            $"    Required Component: {requiredComponentType.Name} " +
            (requiredComponentTag != null ? $"(tag: {requiredComponentTag})" : "") + "\n")
 {
     Step = step;
     RequiredComponentType = requiredComponentType;
     RequiredComponentTag  = requiredComponentTag;
 }
Beispiel #3
0
 /// <summary>
 /// Adds a generation step.  Steps are executed in the order they are added.
 /// </summary>
 /// <param name="step">The generation step to add.</param>
 /// <returns>This generator (for chaining).</returns>
 public Generator AddStep(GenerationStep step)
 {
     _generationSteps.Add(step);
     return(this);
 }