Implemented interface member:
method
GetData
System.Windows.Forms.IDataObject.GetData(System.String, System.Boolean)
89 references to GetData
System.Windows.Forms (5)
System\Windows\Forms\OLE\DataObject.cs (5)
236
public virtual object? GetData(string format) =>
GetData
(format, autoConvert: true);
323
public virtual Stream? GetAudioStream() =>
GetData
(DataFormats.WaveAudio, autoConvert: false) as Stream;
328
if (
GetData
(DataFormats.FileDropConstant, autoConvert: true) is string[] strings)
336
public virtual Image? GetImage() =>
GetData
(DataFormats.Bitmap, autoConvert: true) as Image;
342
return
GetData
(ConvertToDataFormats(format), autoConvert: false) is string text ? text : string.Empty;
System.Windows.Forms.Tests (84)
System\Windows\Forms\DataObjectTests.ClipboardTests.cs (5)
49
dataObject.
GetData
(format, autoConvert).Should().BeNull();
117
dataObject.
GetData
(format, autoConvert: false).Should().BeSameAs(input);
118
dataObject.
GetData
(format, autoConvert: true).Should().BeSameAs(input);
174
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
175
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
System\Windows\Forms\DataObjectTests.cs (79)
241
.Setup(o => o.
GetData
(DataFormats.WaveAudio, false))
245
mockDataObject.Verify(o => o.
GetData
(DataFormats.WaveAudio, false), Times.Once());
284
.Setup(o => o.
GetData
(format, true))
288
mockDataObject.Verify(o => o.
GetData
(format, true), Times.Once());
332
dataObject.
GetData
(format, autoConvert).Should().BeSameAs(result);
669
.Setup(o => o.
GetData
(DataFormats.FileDrop, true))
673
mockDataObject.Verify(o => o.
GetData
(DataFormats.FileDrop, true), Times.Once());
839
.Setup(o => o.
GetData
(DataFormats.Bitmap, true))
843
mockDataObject.Verify(o => o.
GetData
(DataFormats.Bitmap, true), Times.Once());
945
.Setup(o => o.
GetData
(expectedFormat, false))
949
mockDataObject.Verify(o => o.
GetData
(expectedFormat, false), Times.Once());
975
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: true).Should().BeOfType<MemoryStream>().Subject.ToArray().Should().Equal(audioBytes);
976
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: false).Should().BeOfType<MemoryStream>().Subject.ToArray().Should().Equal(audioBytes);
1033
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: true).Should().BeSameAs(audioStream);
1034
dataObject.
GetData
(DataFormats.WaveAudio, autoConvert: false).Should().BeSameAs(audioStream);
1091
dataObject.
GetData
(format, autoConvert: false).Should().BeSameAs(data);
1092
dataObject.
GetData
(format, autoConvert: true).Should().BeSameAs(data);
1107
dataObject.
GetData
(format, autoConvert: false).Should().Be(data2);
1108
dataObject.
GetData
(format, autoConvert: true).Should().Be(data2);
1123
dataObject.
GetData
(DataFormats.Serializable, autoConvert: false).Should().Be(data1);
1124
dataObject.
GetData
(DataFormats.Serializable, autoConvert: true).Should().Be(data1);
1125
dataObject.
GetData
(data2.GetType().FullName, autoConvert: false).Should().Be(data2);
1126
dataObject.
GetData
(data2.GetType().FullName, autoConvert: true).Should().Be(data2);
1198
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
1199
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
1227
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
1228
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
1260
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: true).Should().BeSameAs(image);
1261
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: false).Should().BeSameAs(image);
1262
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: true).Should().BeSameAs(image);
1263
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: false).Should().BeNull();
1264
dataObject.
GetData
(DataFormats.Dib, autoConvert: true).Should().BeNull();
1265
dataObject.
GetData
(DataFormats.Dib, autoConvert: false).Should().BeNull();
1344
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
1345
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
1375
dataObject.
GetData
(format, autoConvert: false).Should().Be(input);
1376
dataObject.
GetData
(format, autoConvert: true).Should().Be(input);
1413
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: true).Should().BeSameAs(image);
1414
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: false).Should().BeSameAs(image);
1415
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: true).Should().BeSameAs(image);
1416
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: false).Should().BeNull();
1417
dataObject.
GetData
(DataFormats.Dib, autoConvert: true).Should().BeNull();
1418
dataObject.
GetData
(DataFormats.Dib, autoConvert: false).Should().BeNull();
1534
dataObject.
GetData
(DataFormats.FileDrop, autoConvert: true).Should().BeEquivalentTo(filePaths.Cast<string>());
1535
dataObject.
GetData
(DataFormats.FileDrop, autoConvert: false).Should().BeEquivalentTo(filePaths.Cast<string>());
1536
dataObject.
GetData
("FileName", autoConvert: true).Should().BeEquivalentTo(filePaths.Cast<string>());
1537
dataObject.
GetData
("FileName", autoConvert: false).Should().BeNull();
1538
dataObject.
GetData
("FileNameW", autoConvert: true).Should().BeEquivalentTo(filePaths.Cast<string>());
1539
dataObject.
GetData
("FileNameW", autoConvert: false).Should().BeNull();
1594
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: true).Should().BeSameAs(image);
1595
dataObject.
GetData
(DataFormats.Bitmap, autoConvert: false).Should().BeSameAs(image);
1596
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: true).Should().BeSameAs(image);
1597
dataObject.
GetData
(typeof(Bitmap).FullName, autoConvert: false).Should().BeNull();
1598
dataObject.
GetData
(DataFormats.Dib, autoConvert: true).Should().BeNull();
1599
dataObject.
GetData
(DataFormats.Dib, autoConvert: false).Should().BeNull();
1662
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: true).Should().BeSameAs(textData);
1663
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: false).Should().BeSameAs(textData);
1664
dataObject.
GetData
(DataFormats.Text, autoConvert: true).Should().BeSameAs(textData);
1665
dataObject.
GetData
(DataFormats.Text, autoConvert: false).Should().BeNull();
1666
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: true).Should().BeSameAs(textData);
1667
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: false).Should().BeNull();
1668
dataObject.
GetData
(DataFormats.Rtf, autoConvert: true).Should().BeNull();
1669
dataObject.
GetData
(DataFormats.Rtf, autoConvert: false).Should().BeNull();
1670
dataObject.
GetData
(DataFormats.Html, autoConvert: true).Should().BeNull();
1671
dataObject.
GetData
(DataFormats.Html, autoConvert: false).Should().BeNull();
1672
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: true).Should().BeNull();
1673
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: false).Should().BeNull();
1741
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: true).Should().Be(expectedUnicodeText);
1742
dataObject.
GetData
(DataFormats.UnicodeText, autoConvert: false).Should().Be(expectedUnicodeText);
1743
dataObject.
GetData
(DataFormats.Text, autoConvert: true).Should().Be(expectedUnicodeText);
1744
dataObject.
GetData
(DataFormats.Text, autoConvert: false).Should().BeNull();
1745
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: true).Should().Be(expectedUnicodeText);
1746
dataObject.
GetData
(DataFormats.StringFormat, autoConvert: false).Should().BeNull();
1747
dataObject.
GetData
(DataFormats.Rtf, autoConvert: true).Should().Be(expectedRtfText);
1748
dataObject.
GetData
(DataFormats.Rtf, autoConvert: false).Should().Be(expectedRtfText);
1749
dataObject.
GetData
(DataFormats.Html, autoConvert: true).Should().Be(expectedHtmlText);
1750
dataObject.
GetData
(DataFormats.Html, autoConvert: false).Should().Be(expectedHtmlText);
1751
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: true).Should().Be(expectedCsvText);
1752
dataObject.
GetData
(DataFormats.CommaSeparatedValue, autoConvert: false).Should().Be(expectedCsvText);