Microscopic Traffic Simulator

- Main Page
- Packages
- Classes
- Files

- File List

FromUICultureNameToItemChecked.cs
Go to the documentation of this file.
1 using System;
2 using System.Globalization;
3 using System.Windows.Data;
4
5 namespace Microscopic_Traffic_Simulator.Converters
6 {
10 class FromUICultureNameToItemChecked : IValueConverter
11 {
21 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
22 {
23 if ((string)value == (string)parameter)
24 return true;
25 else
26 return false;
27 }
28
38 public object ConvertBack(object value, Type targetType, object parameter,
39 CultureInfo culture)
40 {
41 throw new ApplicationException(App.FindStringResource("UnexpectedErrorMessage"));
42 }
43 }
44 }
Microscopic_Traffic_Simulator.App
GUIInteractions logic for App.xaml
Definition: App.xaml.cs:17
System
Microscopic_Traffic_Simulator
Definition: App.xaml.cs:12
Microscopic_Traffic_Simulator.Converters.FromUICultureNameToItemChecked.Convert
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Convert UICulture name string to status of checkbox item.
Definition: FromUICultureNameToItemChecked.cs:21
Microscopic_Traffic_Simulator.Converters.FromUICultureNameToItemChecked.ConvertBack
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Convert status of checkbox item to UI culture string. Should not be used.
Definition: FromUICultureNameToItemChecked.cs:38