Node system - Added numeric struct and utilized it in nodes

This commit is contained in:
Robert committed 2021-09-30 23:28:01 +02:00
1 parent 4f5d76de88
commit 50b4c71142
16 files changed
+460 -223

No files matched your search

@@ -0,0 +1,27 @@
using System;
using System.Globalization;
using System.Windows.Data;
using Artemis.Core;
namespace Artemis.UI.Shared
{
/// <summary>
/// Converts <see cref="T:System.String" /> into <see cref="Numeric" />.
/// </summary>
[ValueConversion(typeof(string), typeof(Numeric))]
public class StringToNumericConverter : IValueConverter
{
/// <inheritdoc />
public object? Convert(object? value, Type targetType, object parameter, CultureInfo culture)
{
return value?.ToString();
}
/// <inheritdoc />
public object ConvertBack(object? value, Type targetType, object parameter, CultureInfo culture)
{
Numeric.TryParse(value as string, out Numeric result);
return result;
}
}
}