private DiffOption FindDiffOptionByTitle(ObservableCollection <CompareRowVM> rows, string title) { //loop through all DiffOption foreach (DiffOption diffOption in diffOptions) { if (diffOption.IsMatchOrNotMatch) { continue; } //get rows CompareRowVM row = FindByStringId(rows, diffOption.Code); if (row.Title == title) { //Select the current line if it contains the previous contents completely return(diffOption); } } return(null); }
private void ReloadForConcept() { //Create line Dictionary <string, CompareRowVM> rowMap = new Dictionary <string, CompareRowVM>(); foreach (StudyUnitVM studyUnit in StudyUnits) { foreach (Concept concept in studyUnit.AllConceptModels) { CompareRowVM row = CreateRow(rowMap, new GroupId(studyUnit.Id, concept.Id), concept.Title); if (row != null) { rows.Add(row); } } } //Initialize line InitRows(); }
private void ReloadForVariable() { //Create line Dictionary <string, CompareRowVM> rowMap = new Dictionary <string, CompareRowVM>(); foreach (StudyUnitVM studyUnit in StudyUnits) { foreach (Variable variable in studyUnit.VariableModels) { CompareRowVM row = CreateRow(rowMap, new GroupId(studyUnit.Id, variable.Id), variable.Title); if (row != null) { rows.Add(row); } } } //Initialize line InitRows(); }
private static void UpdateCell(CompareCell cell, DiffOption diffOption, ObservableCollection <CompareRowVM> rows) { if (diffOption == null) { return; } if (diffOption.IsPartialMatch) { //Get and save the list of GroupId when matches partially Code contains ROWID cell.CompareValue = Options.COMPARE_VALUE_PARTIALMATCH_CODE; CompareRowVM targetRow = FindByStringId(rows, diffOption.Code); cell.TargetTitle = targetRow.Title; } else { //In the case of ○ or ×, save as is. cell.CompareValue = diffOption.Code; cell.TargetTitle = null; } }
private CompareRowVM CreateRow(Dictionary <string, CompareRowVM> rowMap, GroupId groupId, string title) { //Map for to remember whether you have created the appropriate lines in the title CompareRowVM row = null; if (rowMap.ContainsKey(title)) { row = rowMap[title]; row.AddGroupId(groupId); return(null); } row = new CompareRowVM(StudyUnitVM.GetStudyUnitGuids(StudyUnits)) { Title = title, Parent = this }; row.AddGroupId(groupId); rowMap[title] = row; return(row); }
private CompareRowVM CreateRow(Dictionary<string, CompareRowVM> rowMap, GroupId groupId, string title) { //タイトルに該当する行を作成したかどうかを覚えておくためのマップ CompareRowVM row = null; if (rowMap.ContainsKey(title)) { row = rowMap[title]; row.AddGroupId(groupId); return null; } row = new CompareRowVM(StudyUnitVM.GetStudyUnitGuids(StudyUnits)) { Title = title, Parent = this }; row.AddGroupId(groupId); rowMap[title] = row; return row; }