Files
Nebula-Auth/NebulaAuth/Converters/CoefficientConverter.cs
T
Давид Чернопятов 1e65cd4a06 1.5.3 progress. Added multi-confirmation and code refactorings
NebulaAuth:
- Added MAAC and PortableMaClient for multi-confirmations
- Code clean-ups, removed unused classes, refactoring of old files
- SteamLib updated
- Localization and UI updates
- Dependcies updated to the last version

LegacyConverter:
 - Added mode to decrypt mafiles
2024-10-16 16:31:53 +03:00

22 lines
710 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
namespace NebulaAuth.Converters;
[ValueConversion(typeof(double), typeof(double))]
public class CoefficientConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return System.Convert.ToDouble(value) * System.Convert.ToDouble(parameter, CultureInfo.InvariantCulture);
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
var first = value as double? ?? 0;
var second = parameter as double? ?? 0;
if (second == 0) second = 1;
return first / second;
}
}