src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs
/// <summary>
/// Helper, writing a single property to the screen.
/// It wraps the value of the property if it is tool long to fit.
/// </summary>
/// <param name="k">Index of property to write.</param>
/// <param name="propertyValue">String value of the property to write.</param>
/// <param name="lo">LineOutput interface to write to.</param>
Helper, writing a single property to the screen.
It wraps the value of the property if it is tool long to fit.
Helper writing a single property to the screen . It wraps the value of the property if it is tool long to fit .
private void WriteProperty(int k, string propertyValue, LineOutput lo)
        {
            if (propertyValue == null)
                propertyValue = string.Empty;
            List<string> lines = StringManipulationHelper.SplitLines(propertyValue);
            string padding = null;
            for (int i = 0; i < lines.Count; i++)
            {
                string prependString = null;
                if (i == 0)
                    prependString = _propertyLabels[k];
                else
                {
                    if (padding == null)
                        padding = StringUtil.Padding(_propertyLabelsDisplayLength);
                    prependString = padding;
                }
                WriteSingleLineHelper(prependString, lines[i], lo);
            }
        }
private void WriteProperty ( int k , string propertyValue , LineOutput lo ) { if ( propertyValue == null ) propertyValue = string . Empty ; List < string > lines = StringManipulationHelper . SplitLines ( propertyValue ) ; string padding = null ; for ( int i = 0 ; i < lines . Count ; i ++ ) { string prependString = null ; if ( i == 0 ) prependString = _propertyLabels [ k ] ; else { if ( padding == null ) padding = StringUtil . Padding ( _propertyLabelsDisplayLength ) ; prependString = padding ; } WriteSingleLineHelper ( prependString , lines [ i ] , lo ) ; } }
Helper, writing a single property to the screen.
Helper writing a single property to the screen .
// make sure we honor embedded newlines // padding to use in the lines after the first
k
int
Index of property to write.
Index of property to write .
propertyValue
string
String value of the property to write.
String value of the property to write .
lo
LineOutput
LineOutput interface to write to.
LineOutput interface to write to .