123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Windows.Controls;
- using System.Windows.Data;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.CommonData;
- namespace EfemDualUI.Views.History.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 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;
- }
- }
- }
|