Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 6:36
Steve Holdorf26-Feb-09 6:36 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? [modified] Pin
Steve Holdorf26-Feb-09 7:57
Steve Holdorf26-Feb-09 7:57 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Alan N26-Feb-09 9:30
Alan N26-Feb-09 9:30 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 10:11
Steve Holdorf26-Feb-09 10:11 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 12:18
Steve Holdorf26-Feb-09 12:18 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Ennis Ray Lynch, Jr.26-Feb-09 7:02
Ennis Ray Lynch, Jr.26-Feb-09 7:02 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
led mike26-Feb-09 7:07
led mike26-Feb-09 7:07 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Luc Pattyn26-Feb-09 8:02
sitebuilderLuc Pattyn26-Feb-09 8:02 
Hi,

the params keyword tells the compiler it should collect the remaining arguments and turn them into an object array; yes, you can use params with a delegate; here is an example:
delegate void TestDelegate(params object[] list);
event TestDelegate aha;

public override void Test(int arg) {
    aha+=new TestDelegate(showArgCount);
    aha.Invoke(1);
    aha.Invoke(1, 2, 3, 4);
}

public void showArgCount(object[] args) {
    log("showArgCount: "+args.Length);
}


Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Sunday, June 12, 2011 8:41 AM

GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 8:20
Steve Holdorf26-Feb-09 8:20 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Luc Pattyn26-Feb-09 8:38
sitebuilderLuc Pattyn26-Feb-09 8:38 
Questionhow to apply zoom to usercontrol... Pin
priyareguri26-Feb-09 5:10
priyareguri26-Feb-09 5:10 
AnswerRe: how to apply zoom to usercontrol... [modified] Pin
Calin Tatar26-Feb-09 5:25
Calin Tatar26-Feb-09 5:25 
GeneralRe: how to apply zoom to usercontrol... Pin
priyareguri27-Feb-09 4:43
priyareguri27-Feb-09 4:43 
QuestionCrystal report question Pin
E_Gold26-Feb-09 3:56
E_Gold26-Feb-09 3:56 
AnswerRe: Crystal report question Pin
led mike26-Feb-09 4:37
led mike26-Feb-09 4:37 
AnswerRe: Crystal report question Pin
DaveyM6926-Feb-09 4:51
professionalDaveyM6926-Feb-09 4:51 
GeneralRe: Crystal report question Pin
E_Gold26-Feb-09 11:04
E_Gold26-Feb-09 11:04 
GeneralRe: Crystal report question Pin
led mike26-Feb-09 11:24
led mike26-Feb-09 11:24 
Questiondynamically add a flash object to a C# desktop application Pin
Zap-Man26-Feb-09 3:54
Zap-Man26-Feb-09 3:54 
AnswerRe: dynamically add a flash object to a C# desktop application Pin
led mike26-Feb-09 4:34
led mike26-Feb-09 4:34 
GeneralRe: dynamically add a flash object to a C# desktop application Pin
Zap-Man26-Feb-09 5:05
Zap-Man26-Feb-09 5:05 
GeneralRe: dynamically add a flash object to a C# desktop application Pin
EliottA26-Feb-09 5:42
EliottA26-Feb-09 5:42 
GeneralRe: dynamically add a flash object to a C# desktop application Pin
led mike26-Feb-09 7:11
led mike26-Feb-09 7:11 
GeneralRe: dynamically add a flash object to a C# desktop application Pin
led mike26-Feb-09 5:48
led mike26-Feb-09 5:48 
Questioncreate user and role + sql server for existing database programatically Pin
vineesh v26-Feb-09 3:19
vineesh v26-Feb-09 3:19 

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.