public static void Remove(GroupCellController controller) { int? tempKey = GetKeyByValue(controller); if (tempKey == null) return; var intTempKey = (int) tempKey; CellControllers.Remove(intTempKey); }
public static int? GetKeyByValue(GroupCellController value) { foreach ( var recordOfDictionary in CellControllers.Where(recordOfDictionary => recordOfDictionary.Value.Equals(value))) { return recordOfDictionary.Key; } return null; }
private void SetCellController(Y_NORM_NORMATIVE_CELL cellDataContext) { if (cellDataContext.CONTROLLER == null) { cellDataContext.CONTROLLER = 0; } if (Controllers.CellControllers.ContainsKey(cellDataContext.CONTROLLER)) { CellController = Controllers.CellControllers[cellDataContext.CONTROLLER]; } else { int? newController = cellDataContext.CONTROLLER == 0 ? Controllers.NewKey() : cellDataContext.CONTROLLER; CellController = new GroupCellController(); if (cellDataContext.CONTROLLER == 0) cellDataContext.CONTROLLER = newController; Controllers.CellControllers.Add(newController, CellController); } CellController.CellAdd(this); }