/// <summary> /// Renders a target scenario heading. /// </summary> /// <param name="containerNode">The HTML container to render into.</param> /// <param name="scenario">The target scenario.</param> private static void RenderTargetScenarioHeading(HtmlNode containerNode, TargetScenario scenario) { // Create a header entry var sectionNode = HtmlNode.CreateNode(HtmlResources.SnippetEmptyDiv); sectionNode.InnerHtml = string.Format(CultureInfo.CurrentCulture, HtmlResources.TargetScenarioHeading, scenario.Name, scenario.Name); containerNode.AppendChild(sectionNode); }
/// <summary> /// Initializes a scenario from a messaging object. /// </summary> /// <param name="mo">The messaging object.</param> /// <returns>A new scenario.</returns> private static TargetScenario CreateScenario(this MessagingObject mo) { var scenario = new TargetScenario { Name = mo.Properties[ModelConstants.ScenarioName].ToString(), Activator = mo.CreateScenarioStage() }; return(scenario); }
/// <summary> /// Renders a target scenario by recursively walking the scenario stages. /// </summary> /// <param name="containerNode">The HTML container to render into.</param> /// <param name="scenario">The target scenario.</param> public static void RenderTargetScenario(HtmlNode containerNode, TargetScenario scenario) { _ = containerNode ?? throw new ArgumentNullException(nameof(containerNode)); _ = scenario ?? throw new ArgumentNullException(nameof(scenario)); // Write the heading RenderTargetScenarioHeading(containerNode, scenario); RecurseTargetScenarioStage(containerNode, scenario.Activator); }