PowerShell/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsNotNullConverter.cs

47 lines
1.8 KiB
C#

// 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>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class IsNotNullConverter : IValueConverter
{
#region IValueConverter Members
/// <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();
}
#endregion
}
}