public void ConflictOccurred(IConflict conflict) { foreach (IMergeEventListener listener in _listeners) { listener.ConflictOccurred(conflict); } }
public ConflictPresenter(IXmlChangeReport report, IRetrieveFileVersionsFromRepository fileRetriever) { _fileRetriever = fileRetriever; _report = report;// as XmlAdditionChangeReport; if (_report == null) { _conflict = new UnreadableConflict(report.ChildNode); } else { if (_report.ChildNode.Name == "conflict") // old style situation, only on Tok Pisin before Oct 2009 { _conflict = Conflict.CreateFromConflictElement(_report.ChildNode); } else { var conflictNode = _report.ChildNode.SelectSingleNode("data/conflict"); if (conflictNode != null) { _conflict = Conflict.CreateFromConflictElement(conflictNode); } else { _conflict = new UnreadableConflict(_report.ChildNode); } } } }
/// <summary> /// Add conflict. If RecordContextInConflict fails to set a context, and nodeToFindGeneratorFrom is non-null, /// attempt to add a context based on the argument. /// </summary> public static void AddConflictToListener(IMergeEventListener listener, IConflict conflict, XmlNode oursContext, XmlNode theirsContext, XmlNode ancestorContext, IGenerateHtmlContext htmlContextGenerator, XmlMerger merger, XmlNode nodeToFindGeneratorFrom) { // NB: All these steps are crucially ordered. listener.RecordContextInConflict(conflict); if ((conflict.Context == null || conflict.Context is NullContextDescriptor) && nodeToFindGeneratorFrom != null) { // We are too far up the stack for the listener to have been told a context. // Make one out of the current node. conflict.Context = merger.GetContext(nodeToFindGeneratorFrom); } conflict.MakeHtmlDetails(oursContext, theirsContext, ancestorContext, htmlContextGenerator); listener.ConflictOccurred(conflict); }
private static string MakeHtmlForIncompatibleMove(IConflict conflict, string oldGuid, string elementGuid, XElement element) { var doc = new XmlDocument(); doc.LoadXml(element.ToString()); var sb = new StringBuilder("<head><style type='text/css'>"); sb.Append(FieldWorkObjectContextGenerator.DefaultHtmlContextStyles(doc.DocumentElement)); sb.Append("</style></head><body><div class='description'>"); sb.Append(conflict.GetFullHumanReadableDescription()); string className = element.Name.LocalName; var classAttr = element.Attribute("class"); if (classAttr != null) className = classAttr.Value; sb.Append(String.Format("</div><div> The object that was copied is a {0}:", className)); sb.Append("</div><div class=\"description\">"); sb.Append(new FwGenericHtmlGenerator().MakeHtml(doc.DocumentElement)); sb.Append("</div><div>The original is "); MakeSilfwLink(oldGuid, sb); sb.Append("</div><div>The copy is "); MakeSilfwLink(elementGuid, sb); sb.Append("</div></body>"); return sb.ToString(); }
/// methods public void AddConflict(IConflict conflict) { _conflictList.Add(conflict); }
/// <summary> /// Add conflict. /// </summary> public static void AddConflictToListener(IMergeEventListener listener, IConflict conflict, XmlNode oursContext, XmlNode theirsContext, XmlNode ancestorContext, IGenerateHtmlContext htmlContextGenerator) { AddConflictToListener(listener, conflict, oursContext, theirsContext, ancestorContext, htmlContextGenerator, null, null); }
/// <summary> /// Add conflict. /// </summary> public static void AddConflictToListener(IMergeEventListener listener, IConflict conflict) { AddConflictToListener(listener, conflict, null, null, null); }
public void ConflictOccurred(IConflict conflict) { conflict.WriteAsChorusNotesAnnotation(_writer); }
public void WarningOccurred(IConflict conflict) { }
public void WarningOccurred(IConflict warning) { _stream.WriteLine("warning: "+warning.GetFullHumanReadableDescription()); }
public void ConflictOccurred(IConflict conflict) { _stream.WriteLine(conflict.GetFullHumanReadableDescription()); }
/// <summary> /// Add warning. /// </summary> public static void AddWarningToListener(IMergeEventListener listener, IConflict warning, XmlNode oursContext, XmlNode theirsContext, XmlNode ancestorContext, IGenerateHtmlContext htmlContextGenerator) { // NB: All three of these are crucially ordered. listener.RecordContextInConflict(warning); warning.MakeHtmlDetails(oursContext, theirsContext, ancestorContext, htmlContextGenerator); listener.WarningOccurred(warning); }
/// <summary> /// Add warning. /// </summary> public static void AddWarningToListener(IMergeEventListener listener, IConflict warning) { AddWarningToListener(listener, warning, null, null, null); }
internal void WarningOccurred(IConflict warning) { if (_htmlContextGenerator == null) _htmlContextGenerator = new SimpleHtmlGenerator(); XmlMergeService.AddWarningToListener( EventListener, warning, _oursContext, _theirsContext, _ancestorContext, _htmlContextGenerator); }
internal void ConflictOccurred(IConflict conflict, XmlNode nodeToFindGeneratorFrom) { var contextDescriptorGenerator = GetContextDescriptorGenerator(nodeToFindGeneratorFrom); _htmlContextGenerator = (contextDescriptorGenerator as IGenerateHtmlContext) ?? new SimpleHtmlGenerator(); XmlMergeService.AddConflictToListener( EventListener, conflict, _oursContext, _theirsContext, _ancestorContext, _htmlContextGenerator, this, nodeToFindGeneratorFrom); }
internal void ConflictOccurred(IConflict conflict) { if (_htmlContextGenerator == null) _htmlContextGenerator = new SimpleHtmlGenerator(); XmlMergeService.AddConflictToListener( EventListener, conflict, _oursContext, _theirsContext, _ancestorContext, _htmlContextGenerator); }
public void RecordContextInConflict(IConflict conflict) { Guard.AgainstNull(_context, "_context"); conflict.Context = _context; }
public void RecordContextInConflict(IConflict conflict) { // Only the last listener which actually does something will take effect, but usually only one does, anyway. foreach (IMergeEventListener listener in _listeners) { listener.RecordContextInConflict(conflict); } }
/// <summary> /// Add warning. /// </summary> public static void AddWarningToListener(IMergeEventListener listener, IConflict warning, XmlNode oursContext, XmlNode theirsContext, XmlNode ancestorContext) { AddWarningToListener(listener, warning, oursContext, theirsContext, ancestorContext, new SimpleHtmlGenerator()); }
public void ConflictOccurred(IConflict conflict) { Conflicts.Add(conflict); }
public static string WriteConflictAnnotation(IConflict conflict) { var stringBuilder = new StringBuilder(); using (var stringWriter = new StringWriter(stringBuilder)) using (var textWriter = new XmlTextWriter(stringWriter)) { conflict.WriteAsChorusNotesAnnotation(textWriter); } return stringBuilder.ToString(); }
public void WarningOccurred(IConflict warning) { Warnings.Add(warning); }
/// <summary> /// Historically, this class's implementation of ConflictOccurred (before it was split into two /// interface members) did not push any context. /// To keep the behavior the same, RecordContextInConflict does nothing. /// </summary> /// <param name="conflict"></param> public void RecordContextInConflict(IConflict conflict) { }
public void RecordContextInConflict(IConflict conflict) { conflict.Context = _context; }
public void WarningOccurred(IConflict warning) { warning.Context = _context; warning.WriteAsChorusNotesAnnotation(_writer); }
public void ConflictOccurred(IConflict conflict) { }