| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 | using Aitex.Sorter.Common;using System;using System.Collections.Generic;using System.Globalization;using System.Windows.Controls;using System.Windows.Data;namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory{    /// <summary>    /// WaferHistoryDB.xaml 的交互逻辑    /// </summary>    public partial class WaferHistoryDBView : UserControl    {        public WaferHistoryDBView()        {            InitializeComponent();        }    }    public class HistoryLayoutSelectorConverter : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)        {            if (value != null)            {                var type = ((WaferHistoryItem)value).Type;                switch (type)                {                    case WaferHistoryItemType.None:                        return LotsLayout;                    case WaferHistoryItemType.Lot:                        return WaferLayout;                    case WaferHistoryItemType.Wafer:                        return MovementLayout;                    case WaferHistoryItemType.Recipe:                        return RecipeLayout;                    default:                        break;                }            }            return null;        }        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)        {            return null;        }        public object WaferLayout { get; set; }        public object MovementLayout { get; set; }        public object RecipeLayout { get; set; }        public object LotsLayout { get; set; }    }    public class HistoryLotSelectorConverter : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)        {            if (value != null)            {                var type = ((WaferHistoryItem)value).Type;                switch (type)                {                    case WaferHistoryItemType.Lot:                        return LotsLayout;                    case WaferHistoryItemType.Cj:                        return CjLayout;                    case WaferHistoryItemType.Pj:                        return PjLayout;                    case WaferHistoryItemType.Wafer:                        return MovementLayout;                    default:                        break;                }            }            return null;        }        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)        {            return null;        }        public object LotsLayout { get; set; }        public object CjLayout { get; set; }        public object PjLayout { get; set; }        public object MovementLayout { get; set; }    }    public class HideMinTimeConverters : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            if (value is DateTime)                return (DateTime)value == DateTime.MinValue ? "" : ((DateTime)value).ToString("yyyy-MM-dd HH:mm:ss");            if (DateTime.TryParse((string)value, out DateTime dateTime))                return dateTime == DateTime.MinValue ? "" : dateTime.ToString("yyyy-MM-dd HH:mm:ss");            return "";        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return null;        }    }    public class MinTime2BoolConverters : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            if (value is DateTime)                return (DateTime)value != DateTime.MinValue;            if (DateTime.TryParse((string)value, out DateTime dateTime))                return dateTime != DateTime.MinValue;            return false;        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return null;        }    }    public class RecipeStepNull2Empty : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            if (value != null && (value is List<RecipeStep>) && ((List<RecipeStep>)value).Count > 0)            {                return value;            }            return new List<RecipeStep>() { new RecipeStep() { Name = "", StartTime = DateTime.MinValue, EndTime = DateTime.MinValue, ActualTime = "", SettingTime = "" } };        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return null;        }    }}
 |