Microscopic Traffic Simulator

- Main Page
- Packages
- Classes
- Files

- File List

FromSimulationStepsToPauseToString.cs
Go to the documentation of this file.
1 using System;
2 using System.Windows.Data;
3
4 namespace Microscopic_Traffic_Simulator.Converters
5 {
6 class FromSimulationStepsToPauseToString : IValueConverter
7 {
16 public object Convert(object value, Type targetType, object parameter,
17 System.Globalization.CultureInfo culture)
18 {
19 if ((ulong)value == ulong.MaxValue)
20 return string.Empty;
21 else
22 return value.ToString();
23 }
24
33 public object ConvertBack(object value, Type targetType, object parameter,
34 System.Globalization.CultureInfo culture)
35 {
36 string valueString = (string)value;
37 ulong result;
38 if (ulong.TryParse(valueString, out result))
39 {
40 return result;
41 }
42 else
43 {
44 return null;
45 }
46 }
47 }
48 }
Microscopic_Traffic_Simulator.Converters.FromSimulationStepsToPauseToString.ConvertBack
object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Convert string to simulation speed.
Definition: FromSimulationStepsToPauseToString.cs:33
System
Microscopic_Traffic_Simulator
Definition: App.xaml.cs:12
Microscopic_Traffic_Simulator.Converters.FromSimulationStepsToPauseToString.Convert
object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Convert simulation steps to string.
Definition: FromSimulationStepsToPauseToString.cs:16