Click here to Skip to main content
15,904,346 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hello My Follow Programmer Pin
nagendrathecoder29-Sep-09 2:35
nagendrathecoder29-Sep-09 2:35 
AnswerRe: Hello My Follow Programmer Pin
Paramhans Dubey29-Sep-09 2:41
professionalParamhans Dubey29-Sep-09 2:41 
AnswerRe: Hello My Follow Programmer Pin
Xmen Real 29-Sep-09 2:50
professional Xmen Real 29-Sep-09 2:50 
AnswerRe: Hello My Follow Programmer Pin
Christian Graus29-Sep-09 10:37
protectorChristian Graus29-Sep-09 10:37 
AnswerRe: Hello My Follow Programmer Pin
Harvey Saayman29-Sep-09 12:38
Harvey Saayman29-Sep-09 12:38 
Questiondelete Pin
nhqlbaislwfiikqraqnm29-Sep-09 1:53
nhqlbaislwfiikqraqnm29-Sep-09 1:53 
AnswerRe: Native dll´s into the exe? Pin
freakyit29-Sep-09 1:58
freakyit29-Sep-09 1:58 
GeneralMessage Closed Pin
29-Sep-09 2:11
nhqlbaislwfiikqraqnm29-Sep-09 2:11 
GeneralRe: Native dll´s into the exe? Pin
stancrm29-Sep-09 2:25
stancrm29-Sep-09 2:25 
GeneralRe: Native dll´s into the exe? Pin
nhqlbaislwfiikqraqnm29-Sep-09 2:57
nhqlbaislwfiikqraqnm29-Sep-09 2:57 
GeneralRe: Native dll´s into the exe? Pin
stancrm29-Sep-09 2:59
stancrm29-Sep-09 2:59 
AnswerRe: Native dll´s into the exe? Pin
Luc Pattyn29-Sep-09 3:24
sitebuilderLuc Pattyn29-Sep-09 3:24 
GeneralRe: Native dll´s into the exe? Pin
nhqlbaislwfiikqraqnm29-Sep-09 3:31
nhqlbaislwfiikqraqnm29-Sep-09 3:31 
GeneralRe: Native dll´s into the exe? Pin
Christian Graus29-Sep-09 10:39
protectorChristian Graus29-Sep-09 10:39 
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 

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.