internal static CellBom FindCellBomAtFrom(string productID, string prodVer, CellActionType actionType) { List <CellBom> list = GetCellBomAtFrom(productID, actionType); if (list == null || list.Count == 0) { return(null); } CellBom bom = null; foreach (var item in list) { if (actionType != CellActionType.None && item.ActionType != actionType) { continue; } if (LcdHelper.IsEmptyID(item.CellCode)) { continue; } if (prodVer != Constants.ALL && prodVer != item.FromProductVer) { continue; } bom = item; break; } return(bom); }
internal static List <string> GetCellCodeList(string productID, CellActionType actionType = CellActionType.None) { List <string> list = new List <string>(); var cellBoms = GetCellBomAtFrom(productID, actionType); if (cellBoms == null || cellBoms.Count == 0) { return(list); } foreach (var cellBom in cellBoms) { string cellCode = cellBom.CellCode; if (string.IsNullOrEmpty(cellCode)) { continue; } if (list.Contains(cellCode) == false) { list.AddSort(cellCode); } } return(list); }
public void CellAction(int row, int col, CellActionType action) { Cell cell; if (mineField.TryGetValue(new Coordinates(row, col), out cell)) { if (action == CellActionType.Open && cell.CellType == CellType.Closed) { OpenCell(cell); } else { if (action == CellActionType.NextMarker) { NextMarker(cell); } else { return; } } OnModelUpdated(); CheckGameOver(); } }
internal static string GetCellCode(string productID, string productVer, CellActionType actionType) { CellBom bom = FindCellBomAtFrom(productID, productVer, actionType); if (bom == null) { return(productID); } return(bom.CellCode); }
internal static List <CellBom> GetCellBomByCellCode(string cellCode, CellActionType actionType) { if (string.IsNullOrEmpty(cellCode)) { return(null); } List <CellBom> list; _maps.TryGetValue(cellCode, actionType, out list); return(list); }
//Перевод действия при установке ссылки по шаблону в строку public static string ToRussian(this CellActionType t) { switch (t) { case CellActionType.Link: return("Установить ссылку"); case CellActionType.Value: return("Записать значение"); case CellActionType.Save: return("Cсылка на сохранение"); case CellActionType.Text: return("Записать текст"); } return("Установить ссылку"); }
private static List <CellBom> GetCellBomAtFrom(string productID, CellActionType actionType) { List <CellBom> list = new List <CellBom>(); if (string.IsNullOrEmpty(productID)) { return(list); } if (actionType == CellActionType.None) { foreach (var bomList in _fromListByType.Values) { foreach (var bom in bomList) { //2019.10.29 From(Array/CF) 기준에선 ShopID 체크 X //if (bom.FromShopID != shopID) // continue; if (bom.FromProductID != productID) { continue; } list.Add(bom); } } } else { string key = GetFromListKey(productID, actionType); _fromListByType.TryGetValue(key, out list); } return(list); }
private static string GetFromListKey(string productID, CellActionType actionType) { return(LcdHelper.CreateKey(productID, actionType.ToString())); }
public CellActionArgs(int row, int col, CellActionType cellActionType) { Row = row; Col = col; CellActionType = cellActionType; }