In VB.NET, I am looking at a line of code that passes the following value to a procedure that defines the parameter as type "object."
New Object() {gClient.ContactManager, LyncUri}
Here's the complete relevant code
Dim gClient As Microsoft.Lync.Model.LyncClient
gClient = Microsoft.Lync.Model.LyncClient.GetClient()
gClient.ContactManager.BeginSearch(LyncUri,
Ly.SearchProviders.GlobalAddressList,
Ly.SearchFields.EmailAddresses,
Ly.SearchOptions.IncludeContactsWithoutSipOrTelUri,
1,
AddressOf SearchCallback,
New Object() {gClient.ContactManager, LyncUri})
and procedure definition
Public Function BeginSearch(searchString As String, providers As Microsoft.Lync.Model.SearchProviders, searchFields As Microsoft.Lync.Model.SearchFields, searchOptions As Microsoft.Lync.Model.SearchOptions, maxResults As UInteger, contactsAndGroupsCallback As System.AsyncCallback, state As Object) As System.IAsyncResult
I have seen object initializer code that initializes properties of an object by assigning properties values within the brackets using the syntax format of {property1 = value1, property2 = value}, for example but what exactly is the above code doing?
Dim obj As String() = New String() {"MyObj1", "MyObj2", "MyObj2"}.