Force combination was added

This commit is contained in:
Evgeny Redikultsev
2022-11-27 17:04:34 +05:00
parent c5e503252e
commit 96b331f14c
52 changed files with 427 additions and 214 deletions

View File

@@ -0,0 +1,39 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Strings;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace StructureHelper.Infrastructure.UI.Converters.Units
{
internal class PlainDouble : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
try
{
return (double)value;
}
catch(Exception)
{
return new StructureHelperException(ErrorStrings.DataIsInCorrect);
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
try
{
return CommonOperation.ConvertToDoubleChangeComma((string)value);
}
catch (Exception)
{
return new StructureHelperException(ErrorStrings.DataIsInCorrect);
}
}
}
}