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