0

Hi
Please tell vb.net equivalent of following method:
C# Syntax

public class RecentPosts : Control
  {

    static RecentPosts()
    {
      BuildPostList();
      Post.Saved += new EventHandler<SavedEventArgs>(Post_Saved);
      Post.CommentAdded += delegate { BuildPostList(); };
      Post.CommentRemoved += delegate { BuildPostList(); };
      Post.Rated += delegate { BuildPostList(); };
      BlogSettings.Changed += delegate { BuildPostList(); };
    }
}

I tried using C# to VB.NET code converter which gave me this:
VB Syntax

Public Class RecentPosts
		Inherits Control

		Shared Sub New()
			BuildPostList()
			Post.Saved += New EventHandler(Of SavedEventArgs)(Post_Saved)
			Post.CommentAdded += Function() Do
				BuildPostList()
			End Function
			Post.CommentRemoved += Function() Do
				BuildPostList()
			End Function
			Post.Rated += Function() Do
				BuildPostList()
			End Function
			BlogSettings.Changed += Function() Do
				BuildPostList()
			End Function
		End Sub
End Sub

build in visual studio 2008 gives an error.

Please help

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sknake
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.