nknhat / google-api-for-dotnet

Automatically exported from code.google.com/p/google-api-for-dotnet
0 stars 0 forks source link

v0.3 cannot work with VB (c# ok), because using both method overload and default parameters. #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It's a bug. sorry.

I did not test it on VB.

You know, c# 3.5 do not support named and default parameters for method,
but VB do.

so I need overload every search methods if there are too many parameters.

And c# 4.0 will support named and default parameters, like VB. So I make
the longest search methods with default parameters.

This is the bug, they cannot both exist.

The easiest way to make it run is using the longest one.

/*public IList<IWebResult>*/ Search(
    "test", // string keyword
    1, // int resultCount
    null, // string customSearchId
    null, // string customSearchReference
    SafeLevel.GetDefault(), // string safeLevel
    Language.GetDefault(), // string language
    DuplicateFilter.GetDefault(), // string duplicateFilter
)

Original issue reported on code.google.com by iron9li...@gmail.com on 6 Oct 2009 at 5:10

GoogleCodeExporter commented 8 years ago
Hi,

Please advice me how to use this API using VB.net. It will be  helpfull if you 
can 
provide me a similar sample code for VB.NET also. I am new to .Net coding. I 
was 
getting the error the beloow line.

  'Dim text As String = "我喜欢跑步。"
        Dim text As String = "Hello"
        ' Enter the URL of your site here 
        Dim client As New TranslateClient("http://localhost")
        Dim translated As String
        translated = client.Translate(text, Language.English, 
Language.English) 'error in above line
        Console.WriteLine(translated)

Original comment by chaitanyainfy@gmail.com on 17 Dec 2009 at 9:21

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r107.

Original comment by iron9li...@gmail.com on 19 Mar 2010 at 7:44