This repository has been archived on 2026-03-14. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Eco/VideoBrowser/Converters/MultiplyConverter.cs
2023-07-24 12:00:34 +02:00

51 lines
1.7 KiB
C#

namespace VideoBrowser.Converters
{
using System;
using System.Globalization;
using System.Windows.Data;
/// <summary>
/// Defines the <see cref="MultiplyConverter" />.
/// </summary>
public class MultiplyConverter : IMultiValueConverter
{
#region Methods
/// <summary>
/// The Convert.
/// </summary>
/// <param name="values">The values<see cref="object[]"/>.</param>
/// <param name="targetType">The targetType<see cref="Type"/>.</param>
/// <param name="parameter">The parameter<see cref="object"/>.</param>
/// <param name="culture">The culture<see cref="CultureInfo"/>.</param>
/// <returns>The <see cref="object"/>.</returns>
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var result = 1.0;
for (var i = 0; i < values.Length; i++)
{
if (values[i] is double)
{
result *= (double)values[i];
}
}
return result;
}
/// <summary>
/// The ConvertBack.
/// </summary>
/// <param name="value">The value<see cref="object"/>.</param>
/// <param name="targetTypes">The targetTypes<see cref="Type[]"/>.</param>
/// <param name="parameter">The parameter<see cref="object"/>.</param>
/// <param name="culture">The culture<see cref="CultureInfo"/>.</param>
/// <returns>The <see cref="object[]"/>.</returns>
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new Exception("Not implemented");
}
#endregion Methods
}
}