Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'InlineAssignHelper' is not declared When Converting C# To VB.Net

Here is my code in C#:

 ListBox l = new ListBox();
        foreach (string[] s in Regex.Matches(new WebClient().DownloadString("http://www.hidemyass.com/proxy-list/search-229092"), @"(?:<td class=""leftborder timestamp""(?s).+?<style>)((?s).+?)\s*<td>\s+(\d{2,5})</td>").Cast<Match>().Select(m => new string[] { m.Groups[1].Value, m.Groups[2].Value }))
        {
            Regex.Matches(s[0], @"\.([^\{]+)\{([^\}]+)\}").Cast<Match>().ToList().ForEach(m => s[0] = s[0].Replace(string.Format(@"class=""{0}""", m.Groups[1].Value), string.Format(@"style=""{0}""", m.Groups[2].Value)));

Now here is what codes out after I converted it using this:

     Dim l As New ListBox()
    For Each s As String() In Regex.Matches(New WebClient().DownloadString("http://www.hidemyass.com/proxy-list/search-229092"), "(?:<td class=""leftborder timestamp""(?s).+?<style>)((?s).+?)\s*<td>\s+(\d{2,5})</td>").Cast(Of Match)().[Select](Function(m) New String() {m.Groups(1).Value, m.Groups(2).Value})
        Regex.Matches(s(0), "\.([^\{]+)\{([^\}]+)\}").Cast(Of Match)().ToList().ForEach(Function(m) InlineAssignHelper(s(0), s(0).Replace(String.Format("class=""{0}""", m.Groups(1).Value), String.Format("style=""{0}""", m.Groups(2).Value))))
        l.Items.Add(String.Concat(Regex.Matches(Regex.Replace(Regex.Replace(s(0), "<(span|div) style=""display:none"">[\d\.]+</\1>", String.Empty).Remove(0, s(0).IndexOf("/style>")), "class=""\d+""", String.Empty), "[\d\.]+").Cast(Of Match)().[Select](Function(m) m.Value)) & ":" & s(1))
    Next

I am getting an error saying:

Error   1   'InlineAssignHelper' is not declared. It may be inaccessible due to its protection level.

What should InlineAssingHelper be?

like image 528
user1992271 Avatar asked Jan 31 '13 04:01

user1992271


1 Answers

Add a function something like this:

Private Shared Function InlineAssignHelper(Of T)(ByRef target As T, ByVal value As T) As T
  target = value
  Return value
End Function
like image 172
xpda Avatar answered Nov 02 '22 14:11

xpda