Sitecore 5.0 API

MainUtil.ConvertToHashtable Method 

Converts an array list to a hashtable.

[Visual Basic]
Public Shared Function ConvertToHashtable( _
   ByVal list As ArrayList _
) As Hashtable
[C#]
public static Hashtable ConvertToHashtable(
   ArrayList list
);

Parameters

list
An array list of values.

Return Value

A hashtable.

Remarks

The hashtable collection is built by using values from the array list in pairs. An array list consisting of { "Name1", "Value1", "Name2", "Value2" } are converted to ("Name1", "Value1"), ("Name2", "Value2").

Example

  ArrayList list = new ArrayList(new string[] {"Name1", "Value1", "Name2", "Value2"});
  Hashtable collection = MainUtil.ConvertToHashtable(list);

See Also

MainUtil Class | Sitecore Namespace