Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
InvertBool.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.Globalization;
5 
6 namespace SiliconStudio.Presentation.ValueConverters
7 {
8  /// <summary>
9  /// This converter will invert a boolean value. <see cref="ConvertBack"/> is supported and does basically the same operation as <see cref="Convert"/>.
10  /// </summary>
11  public class InvertBool : ValueConverterBase<InvertBool>
12  {
13  /// <inheritdoc/>
14  public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15  {
16  bool result = System.Convert.ToBoolean(value);
17  return !result;
18  }
19 
20  /// <inheritdoc/>
21  public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22  {
23  return Convert(value, targetType, parameter, culture);
24  }
25  }
26 }
override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Definition: InvertBool.cs:21
HRESULT Convert(_In_ const Image &srcImage, _In_ DXGI_FORMAT format, _In_ DWORD filter, _In_ float threshold, _Out_ ScratchImage &image)
This converter will invert a boolean value. ConvertBack is supported and does basically the same oper...
Definition: InvertBool.cs:11
override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Definition: InvertBool.cs:14