Click here to Skip to main content
15,917,642 members
Home / Discussions / C#
   

C#

 
QuestionProcess? Pin
imran_rafique10-Dec-02 9:37
imran_rafique10-Dec-02 9:37 
AnswerRe: Process? Pin
Rob Graham10-Dec-02 12:50
Rob Graham10-Dec-02 12:50 
GeneralRe: Process? Pin
David Stone10-Dec-02 13:58
sitebuilderDavid Stone10-Dec-02 13:58 
GeneralRe: Process? Pin
Rob Graham10-Dec-02 15:09
Rob Graham10-Dec-02 15:09 
GeneralRe: Process? Pin
imran_rafique11-Dec-02 11:56
imran_rafique11-Dec-02 11:56 
Questionvirtual mode? Pin
User 988510-Dec-02 8:05
User 988510-Dec-02 8:05 
GeneralDelegates or objects Pin
User 988510-Dec-02 7:53
User 988510-Dec-02 7:53 
GeneralRe: Delegates or objects Pin
leppie10-Dec-02 8:29
leppie10-Dec-02 8:29 
Thomas George wrote:
In other words, can delegates be stored in a container and iterated?

Yes Smile | :) Here's some code I did in a number solving program:

public NumberSolver(int result, ArrayList numbers)
{
   this.result = result;
   this.numbers = numbers;
   functions = new ArrayList();

   functions.Add( new FunctionHandler( this.Add ));
   functions.Add( new FunctionHandler( this.Subtract ));
   functions.Add( new FunctionHandler( this.Multiply ));
   functions.Add( new FunctionHandler( this.Divide ));
   functions.Add( new FunctionHandler( this.Power ));
}
...
public delegate int FunctionHandler(int a, int b);
...
//in some method, not clear now ;P
int output = numbers[0];
for (int i = 0; i < functions.Count; i++)
{
   FunctionHandler func = (FunctionHandler) functions[i];
   output = func(output, numbers[i + 1]);
}
return output; 


Not sure if this is what you meant, but hope it helps Smile | :)

DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
GeneralRe: Delegates or objects Pin
User 988510-Dec-02 9:03
User 988510-Dec-02 9:03 
GeneralRe: Delegates or objects Pin
leppie10-Dec-02 11:27
leppie10-Dec-02 11:27 
GeneralXml Documentation Pin
afronaut10-Dec-02 7:06
afronaut10-Dec-02 7:06 
GeneralRe: Xml Documentation Pin
Not Active10-Dec-02 7:24
mentorNot Active10-Dec-02 7:24 
GeneralRe: Xml Documentation Pin
Kannan Kalyanaraman10-Dec-02 22:14
Kannan Kalyanaraman10-Dec-02 22:14 
GeneralWeb Service authentication issue Pin
Craig James10-Dec-02 4:37
Craig James10-Dec-02 4:37 
GeneralRe: Web Service authentication issue Pin
OBRon11-Dec-02 9:58
OBRon11-Dec-02 9:58 
GeneralOwnderDraw ComboBox Pin
mikasa10-Dec-02 3:27
mikasa10-Dec-02 3:27 
GeneralCast an Array to a Treenode Array Pin
Paul Watson10-Dec-02 1:15
sitebuilderPaul Watson10-Dec-02 1:15 
GeneralRe: Cast an Array to a Treenode Array Pin
James T. Johnson10-Dec-02 1:28
James T. Johnson10-Dec-02 1:28 
GeneralRe: Cast an Array to a Treenode Array Pin
Paul Watson10-Dec-02 1:32
sitebuilderPaul Watson10-Dec-02 1:32 
GeneralRe: Cast an Array to a Treenode Array Pin
leppie10-Dec-02 8:02
leppie10-Dec-02 8:02 
GeneralRe: Cast an Array to a Treenode Array Pin
Paul Watson10-Dec-02 20:39
sitebuilderPaul Watson10-Dec-02 20:39 
GeneralRe: Cast an Array to a Treenode Array Pin
Nick Parker10-Dec-02 4:14
protectorNick Parker10-Dec-02 4:14 
GeneralRe: Cast an Array to a Treenode Array Pin
James T. Johnson10-Dec-02 8:29
James T. Johnson10-Dec-02 8:29 
GeneralOpenDialog Pin
fredza9-Dec-02 21:36
fredza9-Dec-02 21:36 
GeneralControl bar Pin
fredza9-Dec-02 21:33
fredza9-Dec-02 21:33 

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.