/// <summary> /// Adds the help input or output segment /// </summary> /// <param name="setting">true if it should add the segment</param> /// <param name="sectionTitle">title of the section</param> /// <param name="inputOrOutputProperty">property with the outer object</param> /// <param name="inputOrOutputInnerProperty">property with the inner object</param> private void AddInputOrOutputEntries(bool setting, string sectionTitle, string inputOrOutputProperty, string inputOrOutputInnerProperty) { if (!setting) { return; } PSObject rootObject = HelpParagraphBuilder.GetPropertyObject(this.psObj, inputOrOutputProperty) as PSObject; if (rootObject == null) { return; } object[] inputOrOutputObjs; inputOrOutputObjs = HelpParagraphBuilder.GetPropertyObjectArray(rootObject, inputOrOutputInnerProperty); if (inputOrOutputObjs == null || inputOrOutputObjs.Length == 0) { return; } this.AddText(sectionTitle, true); this.AddText("\r\n", false); foreach (object inputOrOutputObj in inputOrOutputObjs) { PSObject inputOrOutput = inputOrOutputObj as PSObject; if (inputOrOutput == null) { continue; } string type = HelpParagraphBuilder.GetInnerPSObjectPropertyString(inputOrOutput, "type", "name"); string description = GetTextFromArray(inputOrOutput, "description"); this.AddText(HelpParagraphBuilder.AddIndent(type), false); this.AddText("\r\n", false); if (description != null) { this.AddText(HelpParagraphBuilder.AddIndent(description), false); this.AddText("\r\n", false); } } this.AddText("\r\n", false); }