using FurnaceUI.Views.Editors; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; namespace FurnaceUI.Converter { public class LayoutRecipeMonitor1Converter : IValueConverter { private static Dictionary keyValuePairs = new Dictionary(); private static void CreateDict() { if (keyValuePairs.Count == 0) { keyValuePairs.Add(MonitorTransferType.AutoLayout, "Automatic Equal Layout"); keyValuePairs.Add(MonitorTransferType.BoatSlot, "Appoint Boat SlotNo"); keyValuePairs.Add(MonitorTransferType.DirectCarrier, "Appoint between Carriers"); keyValuePairs.Add(MonitorTransferType.AutoCarrier, "Automatic Insert between Carriers"); } } public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { CreateDict(); if (value == null) return keyValuePairs[MonitorTransferType.AutoLayout]; if (value is MonitorTransferType) { return keyValuePairs[(MonitorTransferType)value]; } return keyValuePairs[MonitorTransferType.AutoLayout]; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return parameter.ToString(); } } }