Implemented interface member:
method
GetData
System.Windows.Forms.IDataObject.GetData(System.String, System.Boolean)
85 references to GetData
System.Windows.Forms (5)
System\Windows\Forms\OLE\DataObject.cs (5)
98
public virtual object? GetData(string format) =>
GetData
(format, autoConvert: true);
138
public virtual Stream? GetAudioStream() =>
GetData
(DataFormats.WaveAudio, autoConvert: false) as Stream;
143
if (
GetData
(DataFormats.FileDropConstant, autoConvert: true) is string[] strings)
151
public virtual Image? GetImage() =>
GetData
(DataFormats.Bitmap, autoConvert: true) as Image;
159
return
GetData
(ConvertToDataFormats(format), false) is string text ? text : string.Empty;
System.Windows.Forms.Tests (80)
System\Windows\Forms\DataObjectTests.ClipboardTests.cs (5)
48
dataObject.
GetData
(format, autoConvert).Should().BeNull();
116
dataObject.
GetData
(format, autoConvert: false).Should().BeSameAs(input);
117
dataObject.
GetData
(format, autoConvert: true).Should().BeSameAs(input);
173
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
174
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
System\Windows\Forms\DataObjectTests.cs (75)
233
.Setup(o => o.
GetData
(DataFormats.WaveAudio, false))
237
mockDataObject.Verify(o => o.
GetData
(DataFormats.WaveAudio, false), Times.Once());
276
.Setup(o => o.
GetData
(format, true))
280
mockDataObject.Verify(o => o.
GetData
(format, true), Times.Once());
324
dataObject.
GetData
(format, autoConvert).Should().BeSameAs(result);
523
.Setup(o => o.
GetData
(DataFormats.FileDrop, true))
527
mockDataObject.Verify(o => o.
GetData
(DataFormats.FileDrop, true), Times.Once());
693
.Setup(o => o.
GetData
(DataFormats.Bitmap, true))
697
mockDataObject.Verify(o => o.
GetData
(DataFormats.Bitmap, true), Times.Once());
799
.Setup(o => o.
GetData
(expectedFormat, false))
803
mockDataObject.Verify(o => o.
GetData
(expectedFormat, false), Times.Once());
829
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: true).Should().BeOfType<MemoryStream>().Subject.ToArray().Should().Equal(audioBytes);
830
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: false).Should().BeOfType<MemoryStream>().Subject.ToArray().Should().Equal(audioBytes);
887
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: true).Should().BeSameAs(audioStream);
888
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: false).Should().BeSameAs(audioStream);
945
dataObject.
GetData
(format, autoConvert: false).Should().BeSameAs(data);
946
dataObject.
GetData
(format, autoConvert: true).Should().BeSameAs(data);
961
dataObject.
GetData
(format, autoConvert: false).Should().Be(data2);
962
dataObject.
GetData
(format, autoConvert: true).Should().Be(data2);
977
dataObject.
GetData
(DataFormats.Serializable, autoConvert: false).Should().Be(data1);
978
dataObject.
GetData
(DataFormats.Serializable, autoConvert: true).Should().Be(data1);
979
dataObject.
GetData
(data2.GetType().FullName, autoConvert: false).Should().Be(data2);
980
dataObject.
GetData
(data2.GetType().FullName, autoConvert: true).Should().Be(data2);
1029
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
1030
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
1051
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: true).Should().BeSameAs(image);
1052
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: false).Should().BeSameAs(image);
1053
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: true).Should().BeSameAs(image);
1054
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: false).Should().BeNull();
1055
dataObject.
GetData
(DataFormats.Dib, autoConvert: true).Should().BeNull();
1056
dataObject.
GetData
(DataFormats.Dib, autoConvert: false).Should().BeNull();
1106
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
1107
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
1131
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: true).Should().BeSameAs(image);
1132
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: false).Should().BeSameAs(image);
1133
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: true).Should().BeSameAs(image);
1134
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: false).Should().BeNull();
1135
dataObject.
GetData
(DataFormats.Dib, autoConvert: true).Should().BeNull();
1136
dataObject.
GetData
(DataFormats.Dib, autoConvert: false).Should().BeNull();
1252
dataObject.
GetData
(DataFormats.FileDrop, autoConvert: true).Should().BeEquivalentTo(filePaths.Cast<string>());
1253
dataObject.
GetData
(DataFormats.FileDrop, autoConvert: false).Should().BeEquivalentTo(filePaths.Cast<string>());
1254
dataObject.
GetData
("FileName", autoConvert: true).Should().BeEquivalentTo(filePaths.Cast<string>());
1255
dataObject.
GetData
("FileName", autoConvert: false).Should().BeNull();
1256
dataObject.
GetData
("FileNameW", autoConvert: true).Should().BeEquivalentTo(filePaths.Cast<string>());
1257
dataObject.
GetData
("FileNameW", autoConvert: false).Should().BeNull();
1312
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: true).Should().BeSameAs(image);
1313
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: false).Should().BeSameAs(image);
1314
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: true).Should().BeSameAs(image);
1315
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: false).Should().BeNull();
1316
dataObject.
GetData
(DataFormats.Dib, autoConvert: true).Should().BeNull();
1317
dataObject.
GetData
(DataFormats.Dib, autoConvert: false).Should().BeNull();
1380
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: true).Should().BeSameAs(textData);
1381
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: false).Should().BeSameAs(textData);
1382
dataObject.
GetData
(DataFormats.Text, autoConvert: true).Should().BeSameAs(textData);
1383
dataObject.
GetData
(DataFormats.Text, autoConvert: false).Should().BeNull();
1384
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: true).Should().BeSameAs(textData);
1385
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: false).Should().BeNull();
1386
dataObject.
GetData
(DataFormats.Rtf, autoConvert: true).Should().BeNull();
1387
dataObject.
GetData
(DataFormats.Rtf, autoConvert: false).Should().BeNull();
1388
dataObject.
GetData
(DataFormats.Html, autoConvert: true).Should().BeNull();
1389
dataObject.
GetData
(DataFormats.Html, autoConvert: false).Should().BeNull();
1390
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: true).Should().BeNull();
1391
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: false).Should().BeNull();
1459
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: true).Should().Be(expectedUnicodeText);
1460
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: false).Should().Be(expectedUnicodeText);
1461
dataObject.
GetData
(DataFormats.Text, autoConvert: true).Should().Be(expectedUnicodeText);
1462
dataObject.
GetData
(DataFormats.Text, autoConvert: false).Should().BeNull();
1463
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: true).Should().Be(expectedUnicodeText);
1464
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: false).Should().BeNull();
1465
dataObject.
GetData
(DataFormats.Rtf, autoConvert: true).Should().Be(expectedRtfText);
1466
dataObject.
GetData
(DataFormats.Rtf, autoConvert: false).Should().Be(expectedRtfText);
1467
dataObject.
GetData
(DataFormats.Html, autoConvert: true).Should().Be(expectedHtmlText);
1468
dataObject.
GetData
(DataFormats.Html, autoConvert: false).Should().Be(expectedHtmlText);
1469
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: true).Should().Be(expectedCsvText);
1470
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: false).Should().Be(expectedCsvText);