Regarding Passing Parameters

  • Thread starter Thread starter Gopal Prabhakaran
  • Start date Start date
G

Gopal Prabhakaran

Dear All,
I have 1 class namley classa
classa has a method which need a parameter as class methods

How shall i pass class method as parameter to another class method.

Pls help me asap

Thanx
Gopal Prabhakaran
 
Gopal Prabhakaran said:
I have 1 class namley classa
classa has a method which need a parameter as class methods

How shall i pass class method as parameter to another class method.

Sorry, could you rephrase that? I don't quite understand at the moment.
Could you give an example of what exactly you want to do?
 
I think you are asking how to pass class methods as parameters. Not sure
if you can or can't in C# but really don't think you should. I would
suggest you create an interface with the method signature you desire.
Then have every class you wish to pass to the method inherit and
implement that interface. You then pass the class references to your
method and from there you can safely invoke the interface method.
Sorry don't have the time to make an example.

Hope this helps
Leon Lambert
 
Gopal said:
Dear All,
I have 1 class namley classa
classa has a method which need a parameter as class methods

How shall i pass class method as parameter to another class method.

Pls help me asap

Thanx
Gopal Prabhakaran

I think delegates are what you want. Read the C# docs about the
delegate keyword.
 
Back
Top