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

C#

 
QuestionRegarding custom collection. Pin
dayakar_dn29-Sep-09 0:55
dayakar_dn29-Sep-09 0:55 
AnswerRe: Regarding custom collection. Pin
Abhishek Sur29-Sep-09 1:54
professionalAbhishek Sur29-Sep-09 1:54 
AnswerRe: Regarding custom collection. Pin
Calla29-Sep-09 1:56
Calla29-Sep-09 1:56 
QuestionQuckFix - FIX Engine in C# Pin
ritzy pal29-Sep-09 0:54
ritzy pal29-Sep-09 0:54 
Questionspeech rec Pin
kiran_nagar1129-Sep-09 0:49
kiran_nagar1129-Sep-09 0:49 
AnswerRe: speech rec Pin
benjymous29-Sep-09 1:03
benjymous29-Sep-09 1:03 
AnswerRe: speech rec Pin
Abhishek Sur29-Sep-09 1:52
professionalAbhishek Sur29-Sep-09 1:52 
Questionusing delegates to replace methods temporarily Pin
gchff29-Sep-09 0:23
gchff29-Sep-09 0:23 
I have small mystery I've been trying to figure out, which I believe can be solved by delegates in c#, but I could be totally wrong.

Here is the dilema.

I have class A. Class A has a method Foo. Foo will have a set of instructions. However, I am trying to add the ability, during runtime, based on certain conditions, replace the instructions executed by Foo, but only for one particular instance of class A, and only to be executed once before reverting to default behavior.

As I understand delegates with what I've been reading so far, this is what I've tried to do. I declare Foo as a delegate, and another method called DefaultFoo. Elsewhere in the code an anonymous delegate is created and assigned to Foo. After it is executed, Foo is set back to DefaultFoo.

Obviously this doesn't even make it past the compiler. I can't figure out the correct syntax, or if I'm even going about the goal in the right direction.

I would appreciate any and all assistance.
AnswerRe: using delegates to replace methods temporarily Pin
DaveyM6929-Sep-09 0:42
professionalDaveyM6929-Sep-09 0:42 
GeneralRe: using delegates to replace methods temporarily Pin
gchff29-Sep-09 2:29
gchff29-Sep-09 2:29 
GeneralRe: using delegates to replace methods temporarily Pin
DaveyM6929-Sep-09 7:26
professionalDaveyM6929-Sep-09 7:26 
QuestionUsing new version of the assembly Pin
shivapriyak29-Sep-09 0:11
shivapriyak29-Sep-09 0:11 
AnswerRe: Using new version of the assembly Pin
SeMartens29-Sep-09 0:31
SeMartens29-Sep-09 0:31 
GeneralRe: Using new version of the assembly Pin
shivapriyak29-Sep-09 0:46
shivapriyak29-Sep-09 0:46 
QuestionManipulate a 160 char text message Pin
Md. Marufuzzaman28-Sep-09 21:48
professionalMd. Marufuzzaman28-Sep-09 21:48 
AnswerRe: Manipulate a 160 char text message Pin
stancrm28-Sep-09 22:06
stancrm28-Sep-09 22:06 
GeneralRe: Manipulate a 160 char text message Pin
Md. Marufuzzaman28-Sep-09 23:07
professionalMd. Marufuzzaman28-Sep-09 23:07 
AnswerRe: Manipulate a 160 char text message Pin
Keith Barrow29-Sep-09 0:01
professionalKeith Barrow29-Sep-09 0:01 
GeneralRe: Manipulate a 160 char text message Pin
Md. Marufuzzaman29-Sep-09 0:18
professionalMd. Marufuzzaman29-Sep-09 0:18 
QuestionClient - Server application using sockets? Pin
$uresh $hanmugam28-Sep-09 21:41
$uresh $hanmugam28-Sep-09 21:41 
AnswerRe: Client - Server application using sockets? Pin
stancrm28-Sep-09 22:03
stancrm28-Sep-09 22:03 
GeneralRe: Client - Server application using sockets? Pin
$uresh $hanmugam28-Sep-09 23:56
$uresh $hanmugam28-Sep-09 23:56 
GeneralRe: Client - Server application using sockets? crosspost Pin
Richard MacCutchan29-Sep-09 0:19
mveRichard MacCutchan29-Sep-09 0:19 
GeneralRe: Client - Server application using sockets? crosspost Pin
$uresh $hanmugam29-Sep-09 0:20
$uresh $hanmugam29-Sep-09 0:20 
AnswerRe: Client - Server application using sockets? Pin
SeMartens29-Sep-09 0:30
SeMartens29-Sep-09 0:30 

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.