CK.WPF.Controls.NotConverter.Convert C# (CSharp) Method

Convert() public method

public Convert ( object value, Type targetType, object parameter, System culture ) : object
value object
targetType System.Type
parameter object
culture System
return object
        public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )
        {
            if( value == null ) return null;

            bool returnValue;
            if( Boolean.TryParse( value.ToString(), out returnValue ) )
                return !returnValue;

            throw new FormatException( String.Format( "The NotConverter is waiting for a boolean value, not a {0} value.", value.GetType() ) );
        }