DataObjectExtensions
using System.Collections.Specialized;
using System.Private.Windows.Core.Resources;
using System.Runtime.CompilerServices;
namespace System.Private.Windows.Ole
{
internal static class DataObjectExtensions
{
[NullableContext(1)]
internal static void SetFileDropList(this IComVisibleDataObject dataObject, StringCollection filePaths)
{
if (filePaths.OrThrowIfNull("filePaths").Count == 0)
throw new ArgumentException(System.Private.Windows.Core.Resources.SR.CollectionEmptyException);
string[] array = new string[filePaths.Count];
filePaths.CopyTo(array, 0);
string[] array2 = array;
foreach (string text in array2) {
if (string.IsNullOrEmpty(text) || text.Contains(' '))
throw new ArgumentException(string.Format(System.Private.Windows.Core.Resources.SR.Clipboard_InvalidPath, text ?? "<null>", "filePaths"));
}
dataObject.SetData("FileDrop", true, array);
}
}
}