Click here to Skip to main content
15,851,915 members
Home / Discussions / C#
   

C#

 
GeneralRe: ContextMenu on a MenuItem in ContextMenu possible in WPF? Pin
User 1106097918-Jul-16 2:28
User 1106097918-Jul-16 2:28 
GeneralRe: ContextMenu on a MenuItem in ContextMenu possible in WPF? Pin
Imagiv18-Jul-16 3:02
Imagiv18-Jul-16 3:02 
GeneralRe: ContextMenu on a MenuItem in ContextMenu possible in WPF? Pin
Pete O'Hanlon18-Jul-16 3:18
subeditorPete O'Hanlon18-Jul-16 3:18 
AnswerRe: ContextMenu on a MenuItem in ContextMenu possible in WPF? Pin
Mycroft Holmes16-Jul-16 14:43
professionalMycroft Holmes16-Jul-16 14:43 
Questionno parameterless constructor defined for this object Pin
Gilbert Consellado15-Jul-16 18:36
professionalGilbert Consellado15-Jul-16 18:36 
AnswerRe: no parameterless constructor defined for this object Pin
OriginalGriff15-Jul-16 21:04
mveOriginalGriff15-Jul-16 21:04 
GeneralRe: no parameterless constructor defined for this object Pin
Gilbert Consellado16-Jul-16 1:49
professionalGilbert Consellado16-Jul-16 1:49 
GeneralRe: no parameterless constructor defined for this object Pin
OriginalGriff16-Jul-16 2:48
mveOriginalGriff16-Jul-16 2:48 
If I try to duplicate what you have:
C#
    Dictionary<int, MemoryStream> dictionary = new Dictionary<int, MemoryStream>();
    var classObject = new ClassObject("hello");
    int id = 666;
    dictionary.Add(id, new MemoryStream());
    var retriveObject = dictionary[id] as ClassObject;
    }


public class ClassObject : MemoryStream
    {
    public ClassObject(string s) { }
    }
I don't get an error - I do get a null value, but that's what I expect.

So how is my code different from yours?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: no parameterless constructor defined for this object Pin
Gilbert Consellado16-Jul-16 5:00
professionalGilbert Consellado16-Jul-16 5:00 
GeneralRe: no parameterless constructor defined for this object Pin
OriginalGriff16-Jul-16 5:05
mveOriginalGriff16-Jul-16 5:05 
GeneralRe: no parameterless constructor defined for this object Pin
Gilbert Consellado16-Jul-16 5:30
professionalGilbert Consellado16-Jul-16 5:30 
GeneralRe: no parameterless constructor defined for this object Pin
OriginalGriff16-Jul-16 5:35
mveOriginalGriff16-Jul-16 5:35 
AnswerRe: no parameterless constructor defined for this object Pin
Imagiv16-Jul-16 5:13
Imagiv16-Jul-16 5:13 
GeneralRe: no parameterless constructor defined for this object Pin
Gilbert Consellado16-Jul-16 5:43
professionalGilbert Consellado16-Jul-16 5:43 
QuestionHow to load form's content (Controls in form) from XML file Pin
HoaiTamAnh15-Jul-16 16:50
HoaiTamAnh15-Jul-16 16:50 
AnswerRe: How to load form's content (Controls in form) from XML file Pin
Richard MacCutchan15-Jul-16 22:48
mveRichard MacCutchan15-Jul-16 22:48 
AnswerRe: How to load form's content (Controls in form) from XML file Pin
BillWoodruff16-Jul-16 3:34
professionalBillWoodruff16-Jul-16 3:34 
QuestionManually linking in references Pin
TheOnlyRealTodd15-Jul-16 0:33
professionalTheOnlyRealTodd15-Jul-16 0:33 
AnswerRe: Manually linking in references Pin
OriginalGriff15-Jul-16 0:45
mveOriginalGriff15-Jul-16 0:45 
AnswerRe: Manually linking in references Pin
Eddy Vluggen15-Jul-16 0:58
professionalEddy Vluggen15-Jul-16 0:58 
SuggestionRe: Manually linking in references Pin
maverick199115-Jul-16 23:30
professionalmaverick199115-Jul-16 23:30 
QuestionPassing Memory Stream between C# Windows Pin
sunsher14-Jul-16 19:02
sunsher14-Jul-16 19:02 
AnswerRe: Passing Memory Stream between C# Windows Pin
Mycroft Holmes14-Jul-16 21:11
professionalMycroft Holmes14-Jul-16 21:11 
AnswerRe: Passing Memory Stream between C# Windows Pin
Pete O'Hanlon14-Jul-16 21:46
subeditorPete O'Hanlon14-Jul-16 21:46 
GeneralRe: Passing Memory Stream between C# Windows Pin
sunsher17-Jul-16 14:04
sunsher17-Jul-16 14:04 

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.