Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <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);
        }