| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749 | using Aitex.Core.Common;using Aitex.Core.Util;using Caliburn.Micro;using Caliburn.Micro.Core;using FurnaceUI.Models;using MECF.Framework.Common.DataCenter;using MECF.Framework.Common.SubstrateTrackings;using OpenSEMI.ClientBase;using System.Collections.Generic;using System.Linq;using System.Text.RegularExpressions;using System.Windows;using System.Windows.Input;namespace FurnaceUI.Views.Jobs{    public class WaferMapSelectedViewModel : FurnaceModuleUIViewModelBase    {        private string _carrierID;        public string CarrierID        {            get => _carrierID;            set            {                _carrierID = value;                NotifyOfPropertyChange(nameof(CarrierID));            }        }        private string _waferCount = "0";        public string WaferCount        {            get => _waferCount;            set            {                _waferCount = value;                NotifyOfPropertyChange(nameof(WaferCount));            }        }        private string _waferType;        public string WaferType        {            get => _waferType;            set            {                _waferType = value;                NotifyOfPropertyChange(nameof(WaferType));            }        }        private string _waferNo;        public string WaferNo        {            get => _waferNo;            set            {                _waferNo = value;                NotifyOfPropertyChange(nameof(WaferNo));            }        }        private bool _isExistChecked = true;        public bool IsExistChecked        {            get => _isExistChecked;            set            {                _isExistChecked = value;                NotifyOfPropertyChange(nameof(IsExistChecked));            }        }        private bool _isNoneChecked = true;        public bool IsNoneChecked        {            get => _isNoneChecked;            set            {                _isNoneChecked = value;                NotifyOfPropertyChange(nameof(IsNoneChecked));            }        }        private string _slotMap;        public string SlotMap        {            get => _slotMap;            set            {                _slotMap = value;                NotifyOfPropertyChange(nameof(SlotMap));            }        }        private bool _isSelectedSlot1 = false;        public bool IsSelectedSlot1 { get => _isSelectedSlot1; set { _isSelectedSlot1 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot1)); } }        private bool _isSelectedSlot2 = false;        public bool IsSelectedSlot2 { get => _isSelectedSlot2; set { _isSelectedSlot2 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot2)); } }        private bool _isSelectedSlot3 = false;        public bool IsSelectedSlot3 { get => _isSelectedSlot3; set { _isSelectedSlot3 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot3)); } }        private bool _isSelectedSlot4 = false;        public bool IsSelectedSlot4 { get => _isSelectedSlot4; set { _isSelectedSlot4 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot4)); } }        private bool _isSelectedSlot5 = false;        public bool IsSelectedSlot5 { get => _isSelectedSlot5; set { _isSelectedSlot5 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot5)); } }        private bool _isSelectedSlot6 = false;        public bool IsSelectedSlot6 { get => _isSelectedSlot6; set { _isSelectedSlot6 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot6)); } }        private bool _isSelectedSlot7 = false;        public bool IsSelectedSlot7 { get => _isSelectedSlot7; set { _isSelectedSlot7 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot7)); } }        private bool _isSelectedSlot8 = false;        public bool IsSelectedSlot8 { get => _isSelectedSlot8; set { _isSelectedSlot8 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot8)); } }        private bool _isSelectedSlot9 = false;        public bool IsSelectedSlot9 { get => _isSelectedSlot9; set { _isSelectedSlot9 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot9)); } }        private bool _isSelectedSlot10 = false;        public bool IsSelectedSlot10 { get => _isSelectedSlot10; set { _isSelectedSlot10 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot10)); } }        private bool _isSelectedSlot11 = false;        public bool IsSelectedSlot11 { get => _isSelectedSlot11; set { _isSelectedSlot11 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot11)); } }        private bool _isSelectedSlot12 = false;        public bool IsSelectedSlot12 { get => _isSelectedSlot12; set { _isSelectedSlot12 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot12)); } }        private bool _isSelectedSlot13 = false;        public bool IsSelectedSlot13 { get => _isSelectedSlot13; set { _isSelectedSlot13 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot13)); } }        private bool _isSelectedSlot14 = false;        public bool IsSelectedSlot14 { get => _isSelectedSlot14; set { _isSelectedSlot14 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot14)); } }        private bool _isSelectedSlot15 = false;        public bool IsSelectedSlot15 { get => _isSelectedSlot15; set { _isSelectedSlot15 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot15)); } }        private bool _isSelectedSlot16 = false;        public bool IsSelectedSlot16 { get => _isSelectedSlot16; set { _isSelectedSlot16 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot16)); } }        private bool _isSelectedSlot17 = false;        public bool IsSelectedSlot17 { get => _isSelectedSlot17; set { _isSelectedSlot17 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot17)); } }        private bool _isSelectedSlot18 = false;        public bool IsSelectedSlot18 { get => _isSelectedSlot18; set { _isSelectedSlot18 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot18)); } }        private bool _isSelectedSlot19 = false;        public bool IsSelectedSlot19 { get => _isSelectedSlot19; set { _isSelectedSlot19 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot19)); } }        private bool _isSelectedSlot20 = false;        public bool IsSelectedSlot20 { get => _isSelectedSlot20; set { _isSelectedSlot20 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot20)); } }        private bool _isSelectedSlot21 = false;        public bool IsSelectedSlot21 { get => _isSelectedSlot21; set { _isSelectedSlot21 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot21)); } }        private bool _isSelectedSlot22 = false;        public bool IsSelectedSlot22 { get => _isSelectedSlot22; set { _isSelectedSlot22 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot22)); } }        private bool _isSelectedSlot23 = false;        public bool IsSelectedSlot23 { get => _isSelectedSlot23; set { _isSelectedSlot23 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot23)); } }        private bool _isSelectedSlot24 = false;        public bool IsSelectedSlot24 { get => _isSelectedSlot24; set { _isSelectedSlot24 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot24)); } }        private bool _isSelectedSlot25 = false;        public bool IsSelectedSlot25 { get => _isSelectedSlot25; set { _isSelectedSlot25 = value; NotifyOfPropertyChange(nameof(IsSelectedSlot25)); } }        private bool _isEnabledSlot1 = false; public bool IsEnabledSlot1 { get => _isEnabledSlot1; set { _isEnabledSlot1 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot1)); } }        private bool _isEnabledSlot2 = false; public bool IsEnabledSlot2 { get => _isEnabledSlot2; set { _isEnabledSlot2 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot2)); } }        private bool _isEnabledSlot3 = false; public bool IsEnabledSlot3 { get => _isEnabledSlot3; set { _isEnabledSlot3 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot3)); } }        private bool _isEnabledSlot4 = false; public bool IsEnabledSlot4 { get => _isEnabledSlot4; set { _isEnabledSlot4 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot4)); } }        private bool _isEnabledSlot5 = false; public bool IsEnabledSlot5 { get => _isEnabledSlot5; set { _isEnabledSlot5 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot5)); } }        private bool _isEnabledSlot6 = false; public bool IsEnabledSlot6 { get => _isEnabledSlot6; set { _isEnabledSlot6 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot6)); } }        private bool _isEnabledSlot7 = false; public bool IsEnabledSlot7 { get => _isEnabledSlot7; set { _isEnabledSlot7 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot7)); } }        private bool _isEnabledSlot8 = false; public bool IsEnabledSlot8 { get => _isEnabledSlot8; set { _isEnabledSlot8 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot8)); } }        private bool _isEnabledSlot9 = false; public bool IsEnabledSlot9 { get => _isEnabledSlot9; set { _isEnabledSlot9 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot9)); } }        private bool _isEnabledSlot10 = false; public bool IsEnabledSlot10 { get => _isEnabledSlot10; set { _isEnabledSlot10 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot10)); } }        private bool _isEnabledSlot11 = false; public bool IsEnabledSlot11 { get => _isEnabledSlot11; set { _isEnabledSlot11 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot11)); } }        private bool _isEnabledSlot12 = false; public bool IsEnabledSlot12 { get => _isEnabledSlot12; set { _isEnabledSlot12 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot12)); } }        private bool _isEnabledSlot13 = false; public bool IsEnabledSlot13 { get => _isEnabledSlot13; set { _isEnabledSlot13 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot13)); } }        private bool _isEnabledSlot14 = false; public bool IsEnabledSlot14 { get => _isEnabledSlot14; set { _isEnabledSlot14 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot14)); } }        private bool _isEnabledSlot15 = false; public bool IsEnabledSlot15 { get => _isEnabledSlot15; set { _isEnabledSlot15 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot15)); } }        private bool _isEnabledSlot16 = false; public bool IsEnabledSlot16 { get => _isEnabledSlot16; set { _isEnabledSlot16 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot16)); } }        private bool _isEnabledSlot17 = false; public bool IsEnabledSlot17 { get => _isEnabledSlot17; set { _isEnabledSlot17 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot17)); } }        private bool _isEnabledSlot18 = false; public bool IsEnabledSlot18 { get => _isEnabledSlot18; set { _isEnabledSlot18 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot18)); } }        private bool _isEnabledSlot19 = false; public bool IsEnabledSlot19 { get => _isEnabledSlot19; set { _isEnabledSlot19 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot19)); } }        private bool _isEnabledSlot20 = false; public bool IsEnabledSlot20 { get => _isEnabledSlot20; set { _isEnabledSlot20 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot20)); } }        private bool _isEnabledSlot21 = false; public bool IsEnabledSlot21 { get => _isEnabledSlot21; set { _isEnabledSlot21 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot21)); } }        private bool _isEnabledSlot22 = false; public bool IsEnabledSlot22 { get => _isEnabledSlot22; set { _isEnabledSlot22 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot22)); } }        private bool _isEnabledSlot23 = false; public bool IsEnabledSlot23 { get => _isEnabledSlot23; set { _isEnabledSlot23 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot23)); } }        private bool _isEnabledSlot24 = false; public bool IsEnabledSlot24 { get => _isEnabledSlot24; set { _isEnabledSlot24 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot24)); } }        private bool _isEnabledSlot25 = false; public bool IsEnabledSlot25 { get => _isEnabledSlot25; set { _isEnabledSlot25 = value; NotifyOfPropertyChange(nameof(IsEnabledSlot25)); } }            public Aitex.Core.Common.WaferInfo[] Wafers { get; set; }        protected override void OnActivate()        {            base.OnActivate();            for (int i = 0; i < (int)QueryDataClient.Instance.Service.GetConfig("System.CassetteSlotCount"); i++)            {                SlotMap += 0;            }            SetWaferIsEnabled();            AnalysisStrSlots();        }        public string StrSlots { get; set; } = "";        public void EditMap()        {            var windowManager = IoC.Get<IWindowManager>();            SpecifiedMapViewModel specifiedMapViewModel = new SpecifiedMapViewModel();            specifiedMapViewModel.WaferType = WaferType;            if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(specifiedMapViewModel, null, "Slot Map Info"))            {                SlotMap = specifiedMapViewModel.SlotMap;                WaferCount = Regex.Matches(SlotMap, "1").Count.ToString();                if (SlotMap.Contains("1"))                    IsExistChecked = true;                else                    IsNoneChecked = !IsExistChecked;            }        }        private void SetWaferIsEnabled()        {            if (Wafers != null && Wafers.Length > 0)            {                foreach (var item in Wafers)                {                    switch (item.WaferID)                    {                        case "1":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot1 = true;                            break;                        case "2":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot2 = true;                            break;                        case "3":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot3 = true;                            break;                        case "4":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot4 = true;                            break;                        case "5":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot5 = true;                            break;                        case "6":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot6 = true;                            break;                        case "7":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot7 = true;                            break;                        case "8":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot8 = true;                            break;                        case "9":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot9 = true;                            break;                        case "10":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot10 = true;                            break;                        case "11":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot11 = true;                            break;                        case "12":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot12 = true;                            break;                        case "13":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot13 = true;                            break;                        case "14":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot14 = true;                            break;                        case "15":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot15 = true;                            break;                        case "16":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot16 = true;                            break;                        case "17":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot17 = true;                            break;                        case "18":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot18 = true;                            break;                        case "19":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot19 = true;                            break;                        case "20":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot20 = true;                            break;                        case "21":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot21 = true;                            break;                        case "22":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot22 = true;                            break;                        case "23":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot23 = true;                            break;                        case "24":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot24 = true;                             break;                        case "25":                            if (item.Status == WaferStatus.Normal) IsEnabledSlot25 = true;                            break;                        default:                            break;                    }                }            }        }        private void AnalysisStrSlots()        {            if (!string.IsNullOrEmpty(StrSlots))            {                var listSlots = StrSlots.Split('/');                AllClearCmd();                foreach (var item in listSlots)                {                    switch (item)                    {                        case "1":                            if (IsEnabledSlot1) IsSelectedSlot1 = true;                            break;                        case "2":                            if (IsEnabledSlot2) IsSelectedSlot2 = true;                            break;                        case "3":                            if (IsEnabledSlot3) IsSelectedSlot3 = true;                            break;                        case "4":                            if (IsEnabledSlot4) IsSelectedSlot4 = true;                            break;                        case "5":                            if (IsEnabledSlot5) IsSelectedSlot5 = true;                            break;                        case "6":                            if (IsEnabledSlot6) IsSelectedSlot6 = true;                            break;                        case "7":                            if (IsEnabledSlot7) IsSelectedSlot7 = true;                            break;                        case "8":                            if (IsEnabledSlot8) IsSelectedSlot8 = true;                            break;                        case "9":                            if (IsEnabledSlot9) IsSelectedSlot9 = true;                            break;                        case "10":                            if (IsEnabledSlot10) IsSelectedSlot10 = true;                            break;                        case "11":                            if (IsEnabledSlot11) IsSelectedSlot11 = true;                            break;                        case "12":                            if (IsEnabledSlot12) IsSelectedSlot12 = true;                            break;                        case "13":                            if (IsEnabledSlot13) IsSelectedSlot13 = true;                            break;                        case "14":                            if (IsEnabledSlot14) IsSelectedSlot14 = true;                            break;                        case "15":                            if (IsEnabledSlot15) IsSelectedSlot15 = true;                            break;                        case "16":                            if (IsEnabledSlot16) IsSelectedSlot16 = true;                            break;                        case "17":                            if (IsEnabledSlot17) IsSelectedSlot17 = true;                            break;                        case "18":                            if (IsEnabledSlot18) IsSelectedSlot18 = true;                            break;                        case "19":                            if (IsEnabledSlot19) IsSelectedSlot19 = true;                            break;                        case "20":                            if (IsEnabledSlot20) IsSelectedSlot20 = true;                            break;                        case "21":                            if (IsEnabledSlot21) IsSelectedSlot21 = true;                            break;                        case "22":                            if (IsEnabledSlot22) IsSelectedSlot22 = true;                            break;                        case "23":                            if (IsEnabledSlot23) IsSelectedSlot23 = true;                            break;                        case "24":                            if (IsEnabledSlot24) IsSelectedSlot24 = true;                            break;                        case "25":                            if (IsEnabledSlot25) IsSelectedSlot25 = true;                            break;                        default:                            break;                    }                }            }        }        public void WaferMapSelected(string value, object source)        {            switch (value)            {                case "1":                    IsSelectedSlot1 = !IsSelectedSlot1;                    break;                case "2":                    IsSelectedSlot2 = !IsSelectedSlot2;                    break;                case "3":                    IsSelectedSlot3 = !IsSelectedSlot3;                    break;                case "4":                    IsSelectedSlot4 = !IsSelectedSlot4;                    break;                case "5":                    IsSelectedSlot5 = !IsSelectedSlot5;                    break;                case "6":                    IsSelectedSlot6 = !IsSelectedSlot6;                    break;                case "7":                    IsSelectedSlot7 = !IsSelectedSlot7;                    break;                case "8":                    IsSelectedSlot8 = !IsSelectedSlot8;                    break;                case "9":                    IsSelectedSlot9 = !IsSelectedSlot9;                    break;                case "10":                    IsSelectedSlot10 = !IsSelectedSlot10;                    break;                case "11":                    IsSelectedSlot11 = !IsSelectedSlot11;                    break;                case "12":                    IsSelectedSlot12 = !IsSelectedSlot12;                    break;                case "13":                    IsSelectedSlot13 = !IsSelectedSlot13;                    break;                case "14":                    IsSelectedSlot14 = !IsSelectedSlot14;                    break;                case "15":                    IsSelectedSlot15 = !IsSelectedSlot15;                    break;                case "16":                    IsSelectedSlot16 = !IsSelectedSlot16;                    break;                case "17":                    IsSelectedSlot17 = !IsSelectedSlot17;                    break;                case "18":                    IsSelectedSlot18 = !IsSelectedSlot18;                    break;                case "19":                    IsSelectedSlot19 = !IsSelectedSlot19;                    break;                case "20":                    IsSelectedSlot20 = !IsSelectedSlot20;                    break;                case "21":                    IsSelectedSlot21 = !IsSelectedSlot21;                    break;                case "22":                    IsSelectedSlot22 = !IsSelectedSlot22;                    break;                case "23":                    IsSelectedSlot23 = !IsSelectedSlot23;                    break;                case "24":                    IsSelectedSlot24 = !IsSelectedSlot24;                    break;                case "25":                    IsSelectedSlot25 = !IsSelectedSlot25;                    break;                default:                    break;            }            GetSelectedSlot();        }        private List<bool> SelectedSlots = new List<bool>();        private void GetSelectedSlot()        {            SelectedSlots.Clear();            if (IsSelectedSlot1) SelectedSlots.Add(IsSelectedSlot1);            if (IsSelectedSlot2) SelectedSlots.Add(IsSelectedSlot2);            if (IsSelectedSlot3) SelectedSlots.Add(IsSelectedSlot3);            if (IsSelectedSlot4) SelectedSlots.Add(IsSelectedSlot4);            if (IsSelectedSlot5) SelectedSlots.Add(IsSelectedSlot5);            if (IsSelectedSlot6) SelectedSlots.Add(IsSelectedSlot6);            if (IsSelectedSlot7) SelectedSlots.Add(IsSelectedSlot7);            if (IsSelectedSlot8) SelectedSlots.Add(IsSelectedSlot8);            if (IsSelectedSlot9) SelectedSlots.Add(IsSelectedSlot9);            if (IsSelectedSlot10) SelectedSlots.Add(IsSelectedSlot10);            if (IsSelectedSlot11) SelectedSlots.Add(IsSelectedSlot11);            if (IsSelectedSlot12) SelectedSlots.Add(IsSelectedSlot12);            if (IsSelectedSlot13) SelectedSlots.Add(IsSelectedSlot13);            if (IsSelectedSlot14) SelectedSlots.Add(IsSelectedSlot14);            if (IsSelectedSlot15) SelectedSlots.Add(IsSelectedSlot15);            if (IsSelectedSlot16) SelectedSlots.Add(IsSelectedSlot16);            if (IsSelectedSlot17) SelectedSlots.Add(IsSelectedSlot17);            if (IsSelectedSlot18) SelectedSlots.Add(IsSelectedSlot18);            if (IsSelectedSlot19) SelectedSlots.Add(IsSelectedSlot19);            if (IsSelectedSlot20) SelectedSlots.Add(IsSelectedSlot20);            if (IsSelectedSlot21) SelectedSlots.Add(IsSelectedSlot21);            if (IsSelectedSlot22) SelectedSlots.Add(IsSelectedSlot22);            if (IsSelectedSlot23) SelectedSlots.Add(IsSelectedSlot23);            if (IsSelectedSlot24) SelectedSlots.Add(IsSelectedSlot24);            if (IsSelectedSlot25) SelectedSlots.Add(IsSelectedSlot25);            WaferCount = SelectedSlots.Count().ToString();        }        public void AllSetCmd()        {            if (IsEnabledSlot1) IsSelectedSlot1 = true;            if (IsEnabledSlot2) IsSelectedSlot2 = true;            if (IsEnabledSlot3) IsSelectedSlot3 = true;            if (IsEnabledSlot4) IsSelectedSlot4 = true;            if (IsEnabledSlot5) IsSelectedSlot5 = true;            if (IsEnabledSlot6) IsSelectedSlot6 = true;            if (IsEnabledSlot7) IsSelectedSlot7 = true;            if (IsEnabledSlot8) IsSelectedSlot8 = true;            if (IsEnabledSlot9) IsSelectedSlot9 = true;            if (IsEnabledSlot10) IsSelectedSlot10 = true;            if (IsEnabledSlot11) IsSelectedSlot11 = true;            if (IsEnabledSlot12) IsSelectedSlot12 = true;            if (IsEnabledSlot13) IsSelectedSlot13 = true;            if (IsEnabledSlot14) IsSelectedSlot14 = true;            if (IsEnabledSlot15) IsSelectedSlot15 = true;            if (IsEnabledSlot16) IsSelectedSlot16 = true;            if (IsEnabledSlot17) IsSelectedSlot17 = true;            if (IsEnabledSlot18) IsSelectedSlot18 = true;            if (IsEnabledSlot19) IsSelectedSlot19 = true;            if (IsEnabledSlot20) IsSelectedSlot20 = true;            if (IsEnabledSlot21) IsSelectedSlot21 = true;            if (IsEnabledSlot22) IsSelectedSlot22 = true;            if (IsEnabledSlot23) IsSelectedSlot23 = true;            if (IsEnabledSlot24) IsSelectedSlot24 = true;            if (IsEnabledSlot25) IsSelectedSlot25 = true;        }        public void AllClearCmd()        {            IsSelectedSlot1 = false;            IsSelectedSlot2 = false;            IsSelectedSlot3 = false;            IsSelectedSlot4 = false;            IsSelectedSlot5 = false;            IsSelectedSlot6 = false;            IsSelectedSlot7 = false;            IsSelectedSlot8 = false;            IsSelectedSlot9 = false;            IsSelectedSlot10 = false;            IsSelectedSlot11 = false;            IsSelectedSlot12 = false;            IsSelectedSlot13 = false;            IsSelectedSlot14 = false;            IsSelectedSlot15 = false;            IsSelectedSlot16 = false;            IsSelectedSlot17 = false;            IsSelectedSlot18 = false;            IsSelectedSlot19 = false;            IsSelectedSlot20 = false;            IsSelectedSlot21 = false;            IsSelectedSlot22 = false;            IsSelectedSlot23 = false;            IsSelectedSlot24 = false;            IsSelectedSlot25 = false;            NotifyOfPropertyChange(nameof(IsSelectedSlot1));        }        private string GetStrSlotString()        {            List<string> slotStr = new List<string>();            if (IsEnabledSlot1 && IsSelectedSlot1) slotStr.Add("1");            if (IsEnabledSlot2 && IsSelectedSlot2) slotStr.Add("2");            if (IsEnabledSlot3 && IsSelectedSlot3) slotStr.Add("3");            if (IsEnabledSlot4 && IsSelectedSlot4) slotStr.Add("4");            if (IsEnabledSlot5 && IsSelectedSlot5) slotStr.Add("5");            if (IsEnabledSlot6 && IsSelectedSlot6) slotStr.Add("6");            if (IsEnabledSlot7 && IsSelectedSlot7) slotStr.Add("7");            if (IsEnabledSlot8 && IsSelectedSlot8) slotStr.Add("8");            if (IsEnabledSlot9 && IsSelectedSlot9) slotStr.Add("9");            if (IsEnabledSlot10 && IsSelectedSlot10) slotStr.Add("10");            if (IsEnabledSlot11 && IsSelectedSlot11) slotStr.Add("11");            if (IsEnabledSlot12 && IsSelectedSlot12) slotStr.Add("12");            if (IsEnabledSlot13 && IsSelectedSlot13) slotStr.Add("13");            if (IsEnabledSlot14 && IsSelectedSlot14) slotStr.Add("14");            if (IsEnabledSlot15 && IsSelectedSlot15) slotStr.Add("15");            if (IsEnabledSlot16 && IsSelectedSlot16) slotStr.Add("16");            if (IsEnabledSlot17 && IsSelectedSlot17) slotStr.Add("17");            if (IsEnabledSlot18 && IsSelectedSlot18) slotStr.Add("18");            if (IsEnabledSlot19 && IsSelectedSlot19) slotStr.Add("19");            if (IsEnabledSlot20 && IsSelectedSlot20) slotStr.Add("20");            if (IsEnabledSlot21 && IsSelectedSlot21) slotStr.Add("21");            if (IsEnabledSlot22 && IsSelectedSlot22) slotStr.Add("22");            if (IsEnabledSlot23 && IsSelectedSlot23) slotStr.Add("23");            if (IsEnabledSlot24 && IsSelectedSlot24) slotStr.Add("24");            if (IsEnabledSlot25 && IsSelectedSlot25) slotStr.Add("25");            if (slotStr.Count == 0)            {                WaferCount = "0";                return "";            }            else            {                WaferCount = slotStr.Count().ToString();                return string.Join("/", slotStr.ToArray());            }        }        public void AllSetCmdMouseLeftButtonDown(object source, MouseButtonEventArgs e)        {            if (e.StylusDevice != null)            {                e.Handled = true;            }            else            {                AllSetCmd();                e.Handled = true;            }        }        public void AllSetCmdTouchUp(string value, object source, TouchEventArgs e)        {            AllSetCmd();            e.Handled = true;        }        public void AllClearCmdMouseLeftButtonDown(object source, MouseButtonEventArgs e)        {            if (e.StylusDevice != null)            {                e.Handled = true;            }            else            {                AllClearCmd();                e.Handled = true;            }        }        public void AllClearCmdTouchUp(string value, object source, TouchEventArgs e)        {            AllClearCmd();            e.Handled = true;        }        public void WaferMapSelectedMouseLeftButtonDown(string value, object source, MouseButtonEventArgs e)        {            if (e.StylusDevice != null)            {                e.Handled = true;            }            else            {                WaferMapSelected(value, source);                e.Handled = true;            }        }        public void WaferMapSelectedTouchUp(string value, object source, TouchEventArgs e)        {            WaferMapSelected(value, source);            e.Handled = true;        }        public void ClosedCmdMouseLeftButtonDown(object source, MouseButtonEventArgs e)        {            if (e.StylusDevice != null)            {                e.Handled = true;            }            else            {                e.Handled = true;                ClosedCmd();            }        }        public void ClosedCmdTouchUp(object source, TouchEventArgs e)        {            e.Handled = true;            ClosedCmd();        }        public void AcceptCmdMouseLeftButtonDown(object source, MouseButtonEventArgs e)        {            if (e.StylusDevice != null)            {                e.Handled = true;            }            else            {                e.Handled = true;                AcceptCmd();            }        }        public void AcceptCmdTouchUp(object source, TouchEventArgs e)        {            e.Handled = true;            AcceptCmd();        }        public void AcceptCmd()        {            if (string.IsNullOrEmpty(SlotMap))            {                DialogBox.ShowWarning("Specified Map is empty");                return;            }            StrSlots = GetStrSlotString();            ((Window)GetView()).DialogResult = true;        }           public void ClosedCmd()        {            ((Window)GetView()).DialogResult = false;        }    }}
 |