public ConflictListStateApplier(IConflictModelFactory conflictModelFactory, ConflictRowList conflicts) { this._conflictModelFactory = conflictModelFactory; this._conflictRowList = conflicts; SetInitialStates(); RegisterToolEventListeners(); }
private List <IConnectorConflictRow> GetConnectorConflictRows(ConflictRowList list, IToolConflictItem currentConflictItem, IToolConflictItem diffConflictItem, ConflictTreeNode current, ConflictTreeNode diff) { var rows = new List <IConnectorConflictRow>(); int index = 0; var armConnectorsCurrent = new List <(string Description, string Key, string SourceUniqueId, string DestinationUniqueId)>(); var armConnectorsDiff = new List <(string Description, string Key, string SourceUniqueId, string DestinationUniqueId)>(); SetConnectorConflict(current, diff, out armConnectorsCurrent, out armConnectorsDiff, out int maxCount); for (; index < maxCount; index++) { row = new ConnectorConflictRow(); row.CurrentArmConnector = new ConnectorConflictItem.Empty(row.UniqueId); if (armConnectorsCurrent != null && index < armConnectorsCurrent.Count) { SetCurrentConnectorConflict(armConnectorsCurrent[index], list, currentConflictItem); } row.DifferentArmConnector = new ConnectorConflictItem.Empty(row.UniqueId); if (armConnectorsDiff != null && index < armConnectorsDiff.Count) { SetDiffConnectorConflict(armConnectorsDiff[index], list, diffConflictItem); } var sameSourceAndDestination = row.CurrentArmConnector.SourceUniqueId != row.DifferentArmConnector.SourceUniqueId || row.CurrentArmConnector.DestinationUniqueId != row.DifferentArmConnector.DestinationUniqueId; row.HasConflict = sameSourceAndDestination; rows.Add(row); } return(rows); }
public List <ToolConflictRow> CreateList(ConflictRowList list, ConflictTreeNode[] currentTree, ConflictTreeNode[] diffTree) { var _currentTree = currentTree; var _diffTree = diffTree; _list = list; var toolConflictRowList = new List <ToolConflictRow>(); indexDiff = 0; indexCurr = 0; for (int i = 0; i <= MAX_WORKFLOW_ITEMS; i++) { if (i == MAX_WORKFLOW_ITEMS) { Dev2Logger.Error("ConflictRowListBuilder.CreateList: createlist expected to advance", GlobalConstants.WarewolfError); throw new Exception("createlist expected to advance"); } ConflictTreeNode current = null; ConflictTreeNode diff = null; current = GetConflictTreeNode(true, indexCurr, indexDiff, _currentTree); diff = GetConflictTreeNode(false, indexCurr, indexDiff, _diffTree); if (current == null && diff == null) { break; } currentToolConflictItem = null; diffToolConflictItem = null; bool diffFoundInCurrent = _currentTree.Contains(diff); bool currFoundInDifferent = _diffTree.Contains(current); if (diffFoundInCurrent && currFoundInDifferent) { diff = _diffTree.FirstOrDefault(o => o.UniqueId == current.UniqueId); current = _currentTree.FirstOrDefault(o => o.UniqueId == current.UniqueId); } GetToolConflictItems(current, diff, diffFoundInCurrent, currFoundInDifferent); var toolConflictRow = BuildToolConflictRow(list, current, diff); toolConflictRow.IsMergeVisible = toolConflictRow.HasConflict; toolConflictRowList.Add(toolConflictRow); } return(toolConflictRowList); }
private ToolConflictRow BuildToolConflictRow(ConflictRowList list, ConflictTreeNode current, ConflictTreeNode diff) { var currentConnectorConflictTreeNode = currentToolConflictItem is ToolConflictItem.Empty ? null : current; var diffConnectorConflictTreeNode = diffToolConflictItem is ToolConflictItem.Empty ? null : diff; var connectors = GetConnectorConflictRows(list, currentToolConflictItem, diffToolConflictItem, currentConnectorConflictTreeNode, diffConnectorConflictTreeNode); var diffToolConflictItem_override = diffToolConflictItem; if (currentToolConflictItem.Activity != null && diffToolConflictItem.Activity != null && currentToolConflictItem.Activity.Equals(diffToolConflictItem.Activity)) { diffToolConflictItem_override = currentToolConflictItem.Clone(); } var toolConflictRow = ToolConflictRow.CreateConflictRow(currentToolConflictItem, diffToolConflictItem_override, connectors); return(toolConflictRow); }
public MergePreviewWorkflowStateApplier(ConflictRowList conflictList, IMergePreviewWorkflowDesignerViewModel mergePreviewWorkflowDesignerViewModel) { _mergePreviewWorkflowDesignerViewModel = mergePreviewWorkflowDesignerViewModel; _conflictList = conflictList; RegisterEventHandlerForConflictItemChanges(); }