Click here to Skip to main content
15,892,965 members
Home / Discussions / C#
   

C#

 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:57
C-P-User-36-Nov-12 6:57 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 7:59
mvePete O'Hanlon6-Nov-12 7:59 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:53
C-P-User-36-Nov-12 6:53 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 8:10
mvePete O'Hanlon6-Nov-12 8:10 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 9:37
C-P-User-36-Nov-12 9:37 
AnswerRe: 921600 Pin
Dave Kreskowiak1-Nov-12 5:11
mveDave Kreskowiak1-Nov-12 5:11 
GeneralRe: 921600 Pin
C-P-User-31-Nov-12 6:46
C-P-User-31-Nov-12 6:46 
GeneralRe: 921600 Pin
C-P-User-312-Nov-12 6:17
C-P-User-312-Nov-12 6:17 
QuestionThreads and semaphores Pin
C-P-User-331-Oct-12 7:11
C-P-User-331-Oct-12 7:11 
AnswerRe: Threads and semaphores Pin
Clifford Nelson31-Oct-12 8:02
Clifford Nelson31-Oct-12 8:02 
GeneralRe: Threads and semaphores Pin
C-P-User-32-Nov-12 6:27
C-P-User-32-Nov-12 6:27 
GeneralRe: Threads and semaphores Pin
Clifford Nelson2-Nov-12 6:44
Clifford Nelson2-Nov-12 6:44 
Questioncasting at runtime in c# Pin
prasadbuddhika31-Oct-12 6:15
prasadbuddhika31-Oct-12 6:15 
AnswerRe: casting at runtime in c# Pin
Simon_Whale31-Oct-12 6:31
Simon_Whale31-Oct-12 6:31 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika31-Oct-12 6:34
prasadbuddhika31-Oct-12 6:34 
GeneralRe: casting at runtime in c# Pin
Simon_Whale31-Oct-12 6:41
Simon_Whale31-Oct-12 6:41 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika31-Oct-12 6:48
prasadbuddhika31-Oct-12 6:48 
GeneralRe: casting at runtime in c# Pin
Simon_Whale31-Oct-12 6:48
Simon_Whale31-Oct-12 6:48 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika31-Oct-12 17:04
prasadbuddhika31-Oct-12 17:04 
GeneralRe: casting at runtime in c# Pin
Simon_Whale1-Nov-12 0:45
Simon_Whale1-Nov-12 0:45 
The problem is that customObject[y] is returned as an object which is why it fails.

if you then hard code a cast such as for example.

C#
//assume SomeTestClass is the type of class that you are using
//Type type = typeof(SomeTestClass);
responseSync.Object = (SomeTestClass)customObject[y];


it works as you need it to do, but how to create this as a generic routine I'm not sure at the moment as (typeof(SomeTestClass))customObject[y] or even (typeof(SomeTestClass))CustomObject[y] is rejected by the compiler.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

GeneralRe: casting at runtime in c# Pin
prasadbuddhika1-Nov-12 4:24
prasadbuddhika1-Nov-12 4:24 
GeneralRe: casting at runtime in c# Pin
Simon_Whale1-Nov-12 5:05
Simon_Whale1-Nov-12 5:05 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika1-Nov-12 5:25
prasadbuddhika1-Nov-12 5:25 
GeneralRe: casting at runtime in c# Pin
BobJanova1-Nov-12 5:19
BobJanova1-Nov-12 5:19 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika1-Nov-12 5:28
prasadbuddhika1-Nov-12 5:28 

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.