0

I am attempting some experiments using the code samples provided near the bottom of the page

Below are extracts of my VB.NET code based on the link above. Somewhere in the translation I'm missing what is going on here:

Dim auth = New OAuth2Authenticator(Of NativeApplicationClient)(provider, GetAuthorization)

The GetAuthorization method has a signature:

GetAuthorization(arg As NativeApplicationClient)

I am clearly missing something very obvious about the syntax translation between C# and VB.NET, because there is no parameter supplied at the method call in the C# version on the link I supplied.

2
  • It would be easier if you just posted the C# code you are trying to translate rather than making us open a link and find it on another page. Commented May 16, 2012 at 16:29
  • A quick search on the google api .net client for oauth2, I found this page: code.google.com/p/google-api-dotnet-client/wiki/OAuth2 which shows usage using the OAuth2Authenticator. I think he's only trying to create a new object like they do in their example. Commented May 16, 2012 at 16:34

1 Answer 1

3

You must specify the AddressOf parameter to reference a method.

Dim auth = New OAuth2Authenticator(Of NativeApplicationClient)(provider, AddressOf GetAuthorization)
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you; there's apparently a lot I don't fully understand about delegates and .net

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.