469,658 Members | 1,862 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,658 developers. It's quick & easy.

C# to VB.NET conversion (Generics confusion)

Hi

I'm trying to call a C# Method from with VB.NET and am having all
sorts of troubles as I'm new to Generics. The C# method (which I
didn't develop) is as follows:

/// <summary>
/// Implementation of <c>Register(Action&lt;T&gt; handler)</c>
method of <c>ISubscriptionService&lt;T&gt;</c>
/// interface. Subscribes an action to be performed when a
publishing event occures.
/// Implements subscription functionality of the Publish/
Subscribe pattern.
/// The method also processes the filter custom attributes
which allows a user to define filters
/// externally.
/// </summary>
/// <param name="handler">Represents the method that performs
an action on the specified object
/// when a publishing event occures.</param>
public virtual void Register(Action<Thandler)
{

In my VB.NET code I need to call this Register method and pass to it
the name of the Routine I want called when an event is raised. The C#
examples I've been provided are as follows:

To Register your event routine:
eventBrokerService.Register(this.OnConfEventObject sRead);

Declaration of the event rouine:
[MessageIdFilter(EventError.MessageId, ProtocolName = "ConfServer",
SdkName = "Configuration")]
private void OnConfEventError(IMessage theMessage)
{

Can someone help me convert the above statements to register an event
routine and declare an event routine to the equivalent VB.NET syntax.
I'm real stuck!

Thanks
Jun 27 '08 #1
1 925
"Peter" <pe*****@circle-consulting.co.nzschrieb:
I'm trying to call a C# Method from with VB.NET and am having all
sorts of troubles as I'm new to Generics. The C# method (which I
didn't develop) is as follows:
[...]
public virtual void Register(Action<Thandler)
{

In my VB.NET code I need to call this Register method and pass to it
the name of the Routine I want called when an event is raised. The C#
examples I've been provided are as follows:

To Register your event routine:
eventBrokerService.Register(this.OnConfEventObject sRead);
='<...>.Register(New Action(Of <type>)(AddressOf
OnConfEventObjectsRead))'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Vijai Kalyan | last post: by
14 posts views Thread by junky_fellow | last post: by
2 posts views Thread by Wiktor Zychla | last post: by
14 posts views Thread by Richard G. Riley | last post: by
9 posts views Thread by sloan | last post: by
10 posts views Thread by =?Utf-8?B?RWxlbmE=?= | last post: by
2 posts views Thread by joseph_gallagher | last post: by
13 posts views Thread by =?Utf-8?B?RGF2ZSBXZWVkZW4=?= | last post: by
9 posts views Thread by =?Utf-8?B?RmxhdmVsbGUgQmFsbGVt?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.