Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKB/HeuristicLab.MainForm.WPF/NotConverter.cs @ 5328

Last change on this file since 5328 was 4311, checked in by swagner, 14 years ago

Integrated OKB clients for HL 3.3 (#1166)

File size: 1.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Data;
6using System.Globalization;
7
8namespace HeuristicLab.MainForm.WPF {
9
10  public class AndNotConverter : IMultiValueConverter {
11    public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
12      if (values.Length == 2 && values[0] is bool && values[1] is bool && targetType == typeof(bool))
13        return (bool)values[0] && !(bool)values[1];
14      return null;
15    }
16
17    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {
18      throw new NotImplementedException();
19    }
20  }
21
22  public class NotConverter : IValueConverter {
23    public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
24      return !(bool)value;
25    }
26    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
27      return !(bool)value;
28    }
29  }
30}
Note: See TracBrowser for help on using the repository browser.