public string DiffString()
{
if (left == null || right == null)
{
throw new InvalidOperationException(
"This hunk is based on a patch which does not have the compared data.");
}
StringBuilder ret = new StringBuilder();
if (Same)
{
foreach (object item in Left)
{
ret.Append(" ");
ret.Append(item);
ret.Append("\n");
}
}
else
{
foreach (object item in Left)
{
ret.Append("<");
ret.Append(item);
ret.Append("\n");
}
foreach (object item in Right)
{
ret.Append(">");
ret.Append(item);
ret.Append("\n");
}
}
return ret.ToString();
}