Browse Source

fix(DataGrid): CS8073 The result of the expression is always 'true'

pull/8452/head
Giuseppe Lippolis 4 years ago
parent
commit
b63b84860c
  1. 17
      src/Avalonia.Controls.DataGrid/DataGrid.cs

17
src/Avalonia.Controls.DataGrid/DataGrid.cs

@ -5990,15 +5990,14 @@ namespace Avalonia.Controls
/// <returns>The formatted string.</returns>
private string FormatClipboardContent(DataGridRowClipboardEventArgs e)
{
StringBuilder text = new StringBuilder();
for (int cellIndex = 0; cellIndex < e.ClipboardRowContent.Count; cellIndex++)
{
DataGridClipboardCellContent cellContent = e.ClipboardRowContent[cellIndex];
if (cellContent != null)
{
text.Append(cellContent.Content);
}
if (cellIndex < e.ClipboardRowContent.Count - 1)
var text = new StringBuilder();
var clipboardRowContent = e.ClipboardRowContent;
var numberOfItem = clipboardRowContent.Count;
for (int cellIndex = 0; cellIndex < numberOfItem; cellIndex++)
{
var cellContent = clipboardRowContent[cellIndex];
text.Append(cellContent.Content);
if (cellIndex < numberOfItem - 1)
{
text.Append('\t');
}

Loading…
Cancel
Save