Click here to Skip to main content
15,887,175 members
Home / Discussions / C#
   

C#

 
QuestionWorking with Outlook Pin
Yevgeny Efter18-Mar-06 7:10
Yevgeny Efter18-Mar-06 7:10 
AnswerRe: Working with Outlook Pin
Pascal Ganaye18-Mar-06 7:30
Pascal Ganaye18-Mar-06 7:30 
GeneralRe: Working with Outlook Pin
Yevgeny Efter18-Mar-06 17:49
Yevgeny Efter18-Mar-06 17:49 
QuestionRAS Connection Pin
plz.ze18-Mar-06 5:42
plz.ze18-Mar-06 5:42 
QuestionSorry all Pin
CoolASL18-Mar-06 5:40
CoolASL18-Mar-06 5:40 
GeneralRe: Sorry all Pin
Guffa18-Mar-06 8:28
Guffa18-Mar-06 8:28 
GeneralRe: Sorry all Pin
CoolASL19-Mar-06 0:29
CoolASL19-Mar-06 0:29 
QuestionCopy/paste of generic collection Pin
[Gone]18-Mar-06 4:54
[Gone]18-Mar-06 4:54 
My copy/paste operation results in a MemoryStream full of '\0' characters on the Clipboard.
Maybe my approach to copy/paste is wrong when handling generic types?

All entries in the CollectionBase are, of course, ISerializable and the binary serialization to file fully works. The collection is, to sketch the context, a set of shapes and connections of a diagram (application), see the Netron project[^] for details.

Thank you so much for you help. Rose | [Rose]


The copy operation:

CollectionBase<IDiagramEntity> copy = MyDeepCopyOfTheCollectionViaSerialization();
DataFormats.Format format =
DataFormats.GetFormat(typeof(CollectionBase<IDiagramEntity> ).FullName);
IDataObject dataObject = new DataObject();
dataObject.SetData(format.Name, false, copy);
Clipboard.SetDataObject(dataObject, false);


where the MyDeepCopyOfTheCollectionViaSerialization() is :

CollectionBase<T> newobj = null;
MemoryStream stream = new MemoryStream();
GenericFormatter<BinaryFormatter> f = new
GenericFormatter<BinaryFormatter>();
f.Serialize(stream, this);
stream.Seek(0, SeekOrigin.Begin);
newobj = f.Deserialize<CollectionBase<T>>(stream);
stream.Close();
return newobj;


And finally the Paste operation is:

IDataObject data = Clipboard.GetDataObject();
string format = typeof(CollectionBase<IDiagramEntity> ).FullName;
if (data.GetDataPresent(format))
{
 //data.GetData(format) is a MemoryStream rather than a generic collection!  X| 
} 


I thought about it,
I stood up
and I did it.
The Netron Project



-- modified at 10:59 Saturday 18th March, 2006
AnswerRe: Copy/paste of generic collection Pin
leppie18-Mar-06 7:11
leppie18-Mar-06 7:11 
AnswerRe: Copy/paste of generic collection Pin
[Gone]18-Mar-06 7:30
[Gone]18-Mar-06 7:30 
GeneralRe: Copy/paste of generic collection Pin
leppie18-Mar-06 7:43
leppie18-Mar-06 7:43 
GeneralRe: Copy/paste of generic collection Pin
[Gone]18-Mar-06 8:34
[Gone]18-Mar-06 8:34 
QuestionMp3 streaming Pin
dennizsoftware.se18-Mar-06 4:51
dennizsoftware.se18-Mar-06 4:51 
AnswerRe: Mp3 streaming Pin
CoolASL18-Mar-06 6:12
CoolASL18-Mar-06 6:12 
AnswerRe: Mp3 streaming Pin
Dave Kreskowiak18-Mar-06 6:30
mveDave Kreskowiak18-Mar-06 6:30 
AnswerRe: Mp3 streaming Pin
dennizsoftware.se18-Mar-06 21:25
dennizsoftware.se18-Mar-06 21:25 
Questionoutput in predefined format Pin
zhujp9818-Mar-06 4:04
zhujp9818-Mar-06 4:04 
AnswerRe: output in predefined format Pin
Sean Michael Murphy18-Mar-06 4:41
Sean Michael Murphy18-Mar-06 4:41 
AnswerRe: Drawing on a form Pin
Allah On Acid18-Mar-06 6:51
Allah On Acid18-Mar-06 6:51 
QuestionProfiles and training Pin
mahmoud_sam18-Mar-06 0:32
mahmoud_sam18-Mar-06 0:32 
AnswerRe: Profiles and training Pin
Ed.Poore18-Mar-06 11:07
Ed.Poore18-Mar-06 11:07 
QuestionSingleton Infinite LifeTime sets does not work! Why? Pin
Gorbunov17-Mar-06 23:45
Gorbunov17-Mar-06 23:45 
QuestionOpen windows applicaion Pin
howard 789017-Mar-06 22:13
howard 789017-Mar-06 22:13 
AnswerRe: Open windows applicaion Pin
Steve Pullan17-Mar-06 22:38
Steve Pullan17-Mar-06 22:38 
AnswerRe: Open windows applicaion Pin
Thomas Stockwell18-Mar-06 13:44
professionalThomas Stockwell18-Mar-06 13:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.