By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,986 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,986 IT Pros & Developers. It's quick & easy.

C# Clipboard with Reflection question

P: n/a
I have an item that I placed on the clipboard as follows:
Clipboard.SetDataObject(slide);
slide is type SlideType.

Now I'm trying to read the data from the clipboard doing:

foreach (System.Type type in this.slideModules.Values)
{
if (Clipboard.GetDataObject().GetDataPresent(type))
{
Clipboard.GetDataObject().GetData(type);
break;
}
}

However, on the GetData() line, I receive a FileNotFoundException
claiming that SlideType was not found. I suspect the issue is that
SlideType is actually loaded via reflection (it's in a dll I'm loading
at runtime). Is there anyway to get the clipboard to work with types
loaded through reflection?

May 19 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
It depends on the the type of the object in the clipboard, If the object
cannot be represented with one of the standard clipboard formats the object
is serialized. In order to be deserialized on the reading side the consumer
of this object has to know this type.
--

Stoitcho Goutsev (100)

<dm*****@gmail.com> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
I have an item that I placed on the clipboard as follows:
Clipboard.SetDataObject(slide);
slide is type SlideType.

Now I'm trying to read the data from the clipboard doing:

foreach (System.Type type in this.slideModules.Values)
{
if (Clipboard.GetDataObject().GetDataPresent(type))
{
Clipboard.GetDataObject().GetData(type);
break;
}
}

However, on the GetData() line, I receive a FileNotFoundException
claiming that SlideType was not found. I suspect the issue is that
SlideType is actually loaded via reflection (it's in a dll I'm loading
at runtime). Is there anyway to get the clipboard to work with types
loaded through reflection?

May 19 '06 #2

P: n/a
Yeah, it will need to be deserialized. The object is marked as
Serializable. Is there anyway I can provide the "consumer" with the
information it needs to deserialize it?

Thanks for the help.

May 19 '06 #3

P: n/a
The client application needs to reference a dll with declaration of the
type.

--

Stoitcho Goutsev (100)

<dm*****@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
Yeah, it will need to be deserialized. The object is marked as
Serializable. Is there anyway I can provide the "consumer" with the
information it needs to deserialize it?

Thanks for the help.

May 19 '06 #4

P: n/a
Well the client app handling the paste is the one that executed the
copy. So if it has the information such that it can put the object on
the clipboard (serialize it) shouldn't it have enough information to
take it off (deserialize it)? Or am I missing something?

May 19 '06 #5

P: n/a
Yes, it should.
Can you post some simple compilable sample that demonstratest the porblem?
--

Stoitcho Goutsev (100)

<dm*****@gmail.com> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Well the client app handling the paste is the one that executed the
copy. So if it has the information such that it can put the object on
the clipboard (serialize it) shouldn't it have enough information to
take it off (deserialize it)? Or am I missing something?

May 19 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.