public virtual Differences VisitStatementSnippet(StatementSnippet snippet1, StatementSnippet snippet2){ Differences differences = new Differences(snippet1, snippet2); if (snippet1 == null || snippet2 == null){ if (snippet1 != snippet2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++; return differences; } StatementSnippet changes = (StatementSnippet)snippet2.Clone(); StatementSnippet deletions = (StatementSnippet)snippet2.Clone(); StatementSnippet insertions = (StatementSnippet)snippet2.Clone(); if (snippet1.SourceContext.Document == null || snippet2.SourceContext.Document == null){ if (snippet1.SourceContext.Document == snippet2.SourceContext.Document) differences.NumberOfSimilarities++; else differences.NumberOfDifferences++; }else if (snippet1.SourceContext.Document.Name == snippet2.SourceContext.Document.Name) differences.NumberOfSimilarities++; else differences.NumberOfDifferences++; if (differences.NumberOfDifferences == 0){ differences.Changes = null; differences.Deletions = null; differences.Insertions = null; }else{ differences.Changes = changes; differences.Deletions = deletions; differences.Insertions = insertions; } return differences; }
public override StatementSnippet VisitStatementSnippet(StatementSnippet snippet) { if (snippet == null) return null; return base.VisitStatementSnippet((StatementSnippet)snippet.Clone()); }