Thanks for the information Guys.

/Justin

----- Original Message ----- 
From: "ulu" <[email protected]>
To: "Rhino.Mocks" <[email protected]>
Sent: Monday, June 08, 2009 10:37 AM
Subject: [RhinoMocks] Re: vb.net and using delegate



Justin,

Since Vb.Net doesn't have anonymous delegates, and we won't have
statement lambdas until VB10, you have to write a separate Sub and use
a regular delegate:

Expect.Call(AddressOf PersonDeleter)

Sub PersonDeleter
   mockRepository.Delete(person)
End Sub

You'll have to lift the local variables to the class level in order to
make this work.

ulu

On Jun 8, 2:33 pm, Justin <[email protected]> wrote:
> All,
>
> Can someone please help me convert this syntax to work in vb.net?
>
> Expect.Call(delegate { mockRepository.Delete
> (person); });
>
> This works fine in c#.net, but I have not been able to convert this
> void/sub call to vb.net.
>
> I have tried looking at the syntax using reflector and the syntax that
> reflector issued doesn't seem to work.
>
> Does anyone know how to perform such a call in vb.net? I have a sub/
> void method that needs to be called.
>
> This is how I handle calling void methods in c#.net and now I am
> trying to figure out how to do this in vb.net.
>
> Thanks for any help!
>
> /Justin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to