• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2576
  • Last Modified:

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'

0
wenyonk
Asked:
wenyonk
  • 2
  • 2
1 Solution
 
Expert1701Commented:
wenyonk, would you give the following a try?

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

Bob
0
 
Expert1701Commented:
Sorry, what I should have said was:

  copiedData.Add(new TestDataSource(dataSource.DataSource.CopyAll(new App.UsersAndSecurity.CheckPermission(Security.HasAccess), recordType, locationID, accessType)));
0
 
Bob LearnedCommented:
You know what might prove to be useful, if that was not an answer--a better description of the problem space.

Bob
0
 
wenyonkAuthor Commented:
this answer seemed to compile, I'll have to do testing...

Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now