src/Microsoft.PowerShell.GraphicalHost/ManagementList/FilterProviders/ValidatingSelectorValueToDisplayNameConverter.cs
/// <summary>
/// Takes in a value and a converter and runs the converter on the value returning
/// a display friendly name.
/// </summary>
/// <param name="values">
/// The first parameter is the value to get the display name for.
/// The second parameter is the converter.
/// </param>
/// <param name="targetType">
/// Type of string.
/// </param>
/// <param name="parameter">
/// The parameter is not used.
/// </param>
/// <param name="culture">
/// The parameter is not used.
/// </param>
/// <returns>
/// Returns a display friendly name for the first value.
/// </returns>
Takes in a value and a converter and runs the converter on the value returning
a display friendly name.
Takes in a value and a converter and runs the converter on the value returning a display friendly name .
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (null == values)
            {
                throw new ArgumentNullException("values");
            }
            if (2 != values.Length)
            {
                throw new ArgumentException("Two values expected", "values");
            }
            object input = values[0];
            IValueConverter converter = values[1] as IValueConverter;
            if (null == converter)
            {
                throw new ArgumentException("Second value should be a IValueConverter", "values");
            }
            if (typeof(string) != targetType)
            {
                throw new ArgumentException("targetType should be of type string", "targetType");
            }
            return converter.Convert(input, targetType, parameter, culture);
        }
public object Convert ( object [ ] values , Type targetType , object parameter , System . Globalization . CultureInfo culture ) { if ( null == values ) { throw new ArgumentNullException ( " " ) ; } if ( 2 != values . Length ) { throw new ArgumentException ( " " , " " ) ; } object input = values [ 0 ] ; IValueConverter converter = values [ 1 ] as IValueConverter ; if ( null == converter ) { throw new ArgumentException ( " " , " " ) ; } if ( typeof ( string ) != targetType ) { throw new ArgumentException ( " " , " " ) ; } return converter . Convert ( input , targetType , parameter , culture ) ; }
Takes in a value and a converter and runs the converter on the value returning
a display friendly name.
Takes in a value and a converter and runs the converter on the value returning a display friendly name .
// NOTE : null values are ok.
Returns a display friendly name for the first value.
Returns a display friendly name for the first value .
values
object[]
The first parameter is the value to get the display name for.
The second parameter is the converter.
The first parameter is the value to get the display name for . The second parameter is the converter .
targetType
Type
Type of string.
Type of string .
parameter
object
The parameter is not used.
The parameter is not used .
culture
System.Globalization.CultureInfo
The parameter is not used.
The parameter is not used .