WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

Do these additions answer your question?

	[Test]
	public void GetDataTest()
	{
		const int cnt = 512;

		byte[] orig;
		using (var fs = File.OpenRead(TestCaseSources.WordDoc))
			orig = GetFileBytes(fs, cnt);
		var obj = new ShellDataObject([new ShellItem(TestCaseSources.WordDoc)]);

		Assert.That(obj.GetDataPresent(ShellClipboardFormat.CFSTR_FILEDESCRIPTORW));
		var fd = obj.GetData(ShellClipboardFormat.CFSTR_FILEDESCRIPTORW, true);
		Assert.That(fd is ShellFileDescriptor[]);
		Assert.That((ShellFileDescriptor[])fd, Has.Exactly(1).Items);
		Assert.That(((ShellFileDescriptor[])fd)[0].Info.Name, Is.EqualTo(Path.GetFileName(TestCaseSources.WordDoc)));

		Assert.That(obj.GetDataPresent(Shell…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Alex4SSB
Comment options

@dahall
Comment options

@Alex4SSB
Comment options

@dahall
Comment options

Answer selected by Alex4SSB
@Alex4SSB
Comment options

@dahall
Comment options

@Alex4SSB
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants