public List<GroupId> RelatedGroupIds(CompareCell cell) { return RelatedGroupIds(cell.ColumnStudyUnitId); }
private DiffOption FindDiffOption(ObservableCollection<CompareRowVM> rows, CompareCell cell) { //既存のセルの内容からDiffOptionを検索 if (cell == null) { return null; } DiffOption diffOption = null; if (Options.IsPartialMatch(cell.CompareValue)) { diffOption = FindDiffOptionByTitle(rows, cell.TargetTitle); } else { diffOption = FindDiffOptionByCode(cell.CompareValue); } return diffOption; }
private void CreateCells() { rowModel.Cells.Clear(); foreach (string studyUnitId in studyUnitGuids) { CompareCell cell = new CompareCell(); rowModel.Cells.Add(cell); cell.ColumnStudyUnitId = studyUnitId; } }
private static void UpdateCell(CompareCell cell, DiffOption diffOption, ObservableCollection<CompareRowVM> rows) { if (diffOption == null) { return; } if (diffOption.IsPartialMatch) { //部分一致の場合CodeにはROWIDが入っているのでそこから行のGroupIdのリストをとりだして保存 cell.CompareValue = Options.COMPARE_VALUE_PARTIALMATCH_CODE; CompareRowVM targetRow = FindByStringId(rows, diffOption.Code); cell.TargetTitle = targetRow.Title; } else { //○ OR ×の場合はそのまま保存 cell.CompareValue = diffOption.Code; cell.TargetTitle = null; } }
private static ICollection<CompareRow> CreateCompareRows(List<CompareItem> compareItems) { Dictionary<string, CompareRow> rowMap = new Dictionary<string, CompareRow>(); foreach (CompareItem compareItem in compareItems) { CompareRow row = null; if (rowMap.ContainsKey(compareItem.TargetTitle)) { row = rowMap[compareItem.TargetTitle]; } else { row = new CompareRow(); row.Memo = compareItem.Memo; row.Title = compareItem.TargetTitle; rowMap[row.Title] = row; } row.RowGroupIds.Add(compareItem.TargetId); //あくまでもターゲットが基本 if (compareItem.IsMatch) { CompareCell sourceCell = row.FindCell(compareItem.SourceId.StudyUnitId); if (sourceCell == null) { sourceCell = new CompareCell(); sourceCell.CompareValue = Options.COMPARE_VALUE_MATCH_CODE; sourceCell.ColumnStudyUnitId = compareItem.SourceId.StudyUnitId; row.Cells.Add(sourceCell); } } CompareCell targetCell = row.FindCell(compareItem.TargetId.StudyUnitId); if (targetCell == null) { targetCell = new CompareCell(); targetCell.CompareValue = compareItem.IsMatch ? Options.COMPARE_VALUE_MATCH_CODE : Options.COMPARE_VALUE_PARTIALMATCH_CODE; //一致してないのは書き出していないはず if (compareItem.IsPartialPatch) { targetCell.TargetTitle = compareItem.SourceTitle; } targetCell.ColumnStudyUnitId = compareItem.TargetId.StudyUnitId; row.Cells.Add(targetCell); } } return rowMap.Values; }
public List <GroupId> RelatedGroupIds(CompareCell cell) { return(RelatedGroupIds(cell.ColumnStudyUnitId)); }