Link to home
Start Free TrialLog in
Avatar of wenyonk
wenyonk

asked on

No overload for 'HasAccess' matches delegate 'System.EventHandler'

Can someone please help with this line of code conversion from VB to C#?  Below is the original code, my attempt, and the compile errors.


VB
copiedData.Add(New TestDataSource(dataSource.DataSource.CopyAll(AddressOf Security.HasAccess, recordType, locationID, accessType)))


C#
copiedData.Add(new TestDataSource(dataSource.DataSource.CopyAll(new System.EventHandler(Security.HasAccess, recordType, locationID, accessType))));


Errors:
No overload for 'HasAccess' matches delegate 'System.EventHandler'

The best overloaded method match for 'App.ICAEditable.CopyAll(App.UsersAndSecurity.CheckPermission, App.RecordTypeEnum, int, App.AccessTypeEnum)' has some invalid arguments

Argument '1': cannot convert from 'System.EventHandler' to 'App.UsersAndSecurity.CheckPermission'

Avatar of Expert1701
Expert1701

wenyonk, would you give the following a try?

  copiedData.Add(new TestDataSource(dataSource.DataSource.CopyAll(new System.EventHandler(Security.HasAccess), recordType, locationID, accessType)));
Avatar of Bob Learned
System.EventHandler has the signature (object sender, System.EventArgs e)

Bob
ASKER CERTIFIED SOLUTION
Avatar of Expert1701
Expert1701

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You know what might prove to be useful, if that was not an answer--a better description of the problem space.

Bob
Avatar of wenyonk

ASKER

this answer seemed to compile, I'll have to do testing...

Thank you!