| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | 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 LayoutRecipeMonitor2Converter : IValueConverter    {        private static Dictionary<MonitorTransferType, string> keyValuePairs = new Dictionary<MonitorTransferType, string>();        private static void CreateDict()        {            if (keyValuePairs.Count == 0)            {                keyValuePairs.Add(MonitorTransferType.AutoLayout, "Appoint between Carriers");                keyValuePairs.Add(MonitorTransferType.BoatSlot, "Appoint Boat SlotNo.");                keyValuePairs.Add(MonitorTransferType.DirectCarrier, "Appoint between Carriers");                keyValuePairs.Add(MonitorTransferType.AutoCarrier, "Automatic Insert between Carriers");                keyValuePairs.Add(MonitorTransferType.None, "Not Use Monitor Wafer");            }        }        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            CreateDict();            if (value == null)                return keyValuePairs[MonitorTransferType.AutoLayout];            if (value is LayoutReplacement)            {                return keyValuePairs[(MonitorTransferType)value];            }            return keyValuePairs[MonitorTransferType.AutoLayout];        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return parameter.ToString();        }    }   }
 |