CLEAR
do wwDotNetBridge
LOCAL loBridge as wwDotNetBridge
loBridge = GetwwDotnetBridge()

loNet = loBridge.Createinstance("Westwind.WebConnection.TypePassingTests")

*** Work with a List<T> 
? "*** Retrieve a List<T> and Update"

*** Generic List - can't do anything with this
*!*	loList = loNet.GetGenericList()
*!*	? loList && (Object)
*!*	? loList.Count && Nope

*** Indirect access through Proxy
loList = loBridge.InvokeMethod(loNet,"GetGenericList")
? loBridge.ToString(loList)   && System.Collections.Generic.List...
? loList.Count

*** Grab an item by index
loCust =  loList.Item(0)
? loCust.Company

*** Update item (updates underlying collection)
loCust.Company = loCust.Company + " " + TIME()

*** Create new item and add to collection
loCust = loList.CreateItem()
? loCust
loCust.Company = "North Wind Traders"
loList.AddItem(loCust)
? lolist.Count

*** Pass the ComArray instance back to .NET 
? loBridge.InvokeMethod(loNet, "SetGenericList", loList)  && should be 3 


*** Work with Dictionary<string, TestCustomer>
? "*** Retrieve a dictionary and Update"

loList = loBridge.InvokeMethod(loNet,"GetDictionary")
? loBridge.ToString(loList)
? loList.Count  &&  2

*** Return Item by Key
? "*** Return Item1 from dictionary"
loCust =  loList.Item("Item1")   && Retrieve item by Key
? loCust.Company
loCust.Company = loCust.Company + " " + TIME()

? "*** Create a new item (Item3) and Add using AdddictionaryItem()"
loCust = loList.CreateItem()
? loCust
loCust.Company = "North Wind Traders"
loList.AddDictionaryItem("Item3", loCust)


*** Legacy behavior (fix from Christof Wollenhaupt)
? "*** Create a new item (Item4) and Add via Invoke('Add') (legacy)"

loCust = loList.CreateItem()
? loCust
loCust.Company = "NorthWest Wind Traders"
loBridge.InvokeMethod(loList, "Add", "Item4", loCust)

? lolist.Count  && should be 4

? "*** Return Item3 from dictionary"
loCust =  loList.Item("Item3")   && Retrieve item by Key
? loCust.Company
loCust.Company = loCust.Company + " " + TIME()


? "*** Return Item4 from dictionary"
loCust =  loList.Item("Item4")   && Retrieve item by Key
? loCust.Company
loCust.Company = loCust.Company + " " + TIME()


*** You can also 'iterate' the dictionary by using integer 'keys' 
*** This works as long as the key is not of type System.Int to start with
*** The following returns the first item
FOR lnX = 0 TO loList.Count -1
   loItem = lolist.Item(lnX)
   ? loItem.Company
ENDFOR

*** Pass the new dictionary TO .NET
lnCount = loBridge.InvokeMethod(loNet, "SetDictionary", loList)  && should be 4
? lnCount



*** Create a new ComArray and pass to .NET
? "*** Create a new List and pass to .NET"

*** Create an unconfigured ComArray instance
loList  = loBridge.CreateArray()

*** Create List<T>
loList.CreateList("Westwind.WebConnection.TestCustomer")

*** Create a new Person instance (based on the Instance type)
loCust = loList.CreateItem()
? loCust

loCust.Company = "North Wind Traders"
loList.AddItem(loCust)
? lolist.Count

loCust = loList.CreateItem()
? loCust
loCust.Company = "East Wind Traders"
loList.AddItem(loCust)
? lolist.Count

? loBridge.InvokeMethod(loNet, "SetGenericList", loList)  && 2


*** Create a new ComArray and pass to .NET
? "*** Create a new Dictionary and pass to .NET"

*** Create an unconfigured ComArray instance
loList  = loBridge.CreateArray()

*** Create Dictionary<TKey, TValue>
loList.CreateDictionary("System.String", "Westwind.WebConnection.TestCustomer")

*** Create a new Person instance (based on the Instance type)
loCust = loList.CreateItem()
? loCust
loCust.Company = "North Wind Traders"
loList.AddDictionaryItem("Item1" , loCust)
? lolist.Count

loCust = loList.CreateItem()
? loCust
loCust.Company = "East Wind Traders"
loList.AddDictionaryItem("Item2" , loCust)
? lolist.Count

? loBridge.InvokeMethod(loNet, "SetDictionary", loList)  && 2










