Windows-powershell / PowerShell-master /src /Microsoft.Management.UI.Internal /ManagementList /Common /IsNotNullConverter.cs
| // Copyright (c) Microsoft Corporation. | |
| // Licensed under the MIT License. | |
| using System; | |
| using System.Windows.Data; | |
| namespace Microsoft.Management.UI.Internal | |
| { | |
| /// <summary> | |
| /// The IsNotNullConverter is responsible for converting a value into | |
| /// a boolean indicting whether the value is not null. | |
| /// </summary> | |
| [] | |
| public class IsNotNullConverter : IValueConverter | |
| { | |
| /// <summary> | |
| /// Determines if value is not null. | |
| /// </summary> | |
| /// <param name="value">The object to check.</param> | |
| /// <param name="targetType">The parameter is not used.</param> | |
| /// <param name="parameter">The parameter is not used.</param> | |
| /// <param name="culture">The parameter is not used.</param> | |
| /// <returns>Returns true if value is not null, false otherwise.</returns> | |
| public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | |
| { | |
| return value != null; | |
| } | |
| /// <summary> | |
| /// This method is not used. | |
| /// </summary> | |
| /// <param name="value">The parameter is not used.</param> | |
| /// <param name="targetType">The parameter is not used.</param> | |
| /// <param name="parameter">The parameter is not used.</param> | |
| /// <param name="culture">The parameter is not used.</param> | |
| /// <returns>The parameter is not used.</returns> | |
| public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | |
| { | |
| throw new NotSupportedException(); | |
| } | |
| } | |
| } | |