aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/TimeSpanToXConverter.cs
bl
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.PPC.Common.Web
{
    public enum LoginMode
    {
        Machine,
        User,
    }
}
le.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using Tango.MachineStudio.Logging.Helpers;

namespace Tango.MachineStudio.Logging.Converters
{
    public class TimeSpanToXConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values.Length == 2)
            {
                TimeSpan time = (TimeSpan)values[0];
                double scale = (double)values[1];

                return TimelineHelper.ConvertTimeToPixels(time, scale) + (parameter != null ? System.Convert.ToDouble(parameter) : 0);
            }

            return null;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}