| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 | using MECF.Framework.Common.DataCenter;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using Venus_MainPages.Unity;namespace Venus_MainPages.Views{    /// <summary>    /// WaferAssociationSEUnit.xaml 的交互逻辑    /// </summary>    public partial class WaferAssociationSEUnit : UserControl    {        public WaferAssociationSEUnit()        {            InitializeComponent();        }        public WaferAssociationInfo WFInfo        {            get { return (WaferAssociationInfo)GetValue(WFInfoProperty); }            set { SetValue(WFInfoProperty, value); }        }        public static readonly DependencyProperty WFInfoProperty = DependencyProperty.Register("WFInfo", typeof(WaferAssociationInfo), typeof(WaferAssociationSEUnit));        public string SequenceName        {            get { return (string)GetValue(SequenceNameProperty); }            set { SetValue(SequenceNameProperty, value); }        }        public static readonly DependencyProperty SequenceNameProperty = DependencyProperty.Register("SequenceName", typeof(string), typeof(WaferAssociationSEUnit));        public int SelectedIndex        {            get { return (int)GetValue(SelectedIndexProperty); }            set { SetValue(SelectedIndexProperty, value); }        }        public static readonly DependencyProperty SelectedIndexProperty = DependencyProperty.Register("SelectedIndex", typeof(int), typeof(WaferAssociationSEUnit), new PropertyMetadata(1));        public bool ButtonIsEnable        {            get { return (bool)GetValue(ButtonIsEnableProperty); }            set { SetValue(ButtonIsEnableProperty, value); }        }        public static readonly DependencyProperty ButtonIsEnableProperty = DependencyProperty.Register("ButtonIsEnable", typeof(bool), typeof(WaferAssociationSEUnit), new PropertyMetadata(true));        private void cb_DropDownOpened(object sender, EventArgs e)        {            cb.ItemsSource = GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "Sequence")).ToList();        }        private void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)        {            WFInfo.SequenceName = cb.SelectedValue.ToString();        }        private IEnumerable<string> GetFilesNames(string path)        {            if (Directory.Exists(path))            {                return Directory.GetFiles(path, "*.seq")      .Select(System.IO.Path.GetFileNameWithoutExtension);            }            else            {                return new List<string>();            }        }        private void SelectAllButton_Click(object sender, RoutedEventArgs e)        {            SelectedIndex = 0;        }        private void UnSelectAllButton_Click(object sender, RoutedEventArgs e)        {            SelectedIndex = 1;        }    }}
 |