Browse Source

Merge pull request #8452 from workgroupengineering/fixes/Warnings/DataGrid

fix(DataGrid): CS8073 The result of the expression is always 'true'
pull/8465/head
Max Katz 4 years ago
committed by GitHub
parent
commit
377248d491
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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