Delegate

  • Thread starter Thread starter Hai Nguyen
  • Start date Start date
H

Hai Nguyen

I don't know if any body got any error similar to this

"
G:\DelegateExample\DelegateDemo.cs(44): Inconsistent accessibility:
parameter type 'DelegateExample.DelegateDemo.Operator' is less accessible
than method
'DelegateExample.DelegateDemo.Run(DelegateExample.DelegateDemo.Operator,
System.Collections.ArrayList, int)' "

if you did, please show me how to solve the problem


Thanks
 
The problem happens when you have a private (or internal)/protected class
member being exposed by a protected/public (respectively) member.

In your case, I'm assuming Operator class is either internal or private
class, while the Run method is public. Try changing Operator as public.

-vJ
 
Hai Nguyen said:
I don't know if any body got any error similar to this

"
G:\DelegateExample\DelegateDemo.cs(44): Inconsistent accessibility:
parameter type 'DelegateExample.DelegateDemo.Operator' is less accessible
than method
'DelegateExample.DelegateDemo.Run(DelegateExample.DelegateDemo.Operator,
System.Collections.ArrayList, int)' "

if you did, please show me how to solve the problem

Chances are your DelegateExample.DelegateDemo.Operator delegate is
internal, and the Run method is public. Outside the assembly, there's
no such thing as DelegateExample.DelegateDemo.Operator, so the
signature of the public method doesn't make sense.
 
Back
Top