- string[] rawTable = ConvertToString ().Split (';');
- int i = 0;
-
- if (type == typeof (bool[])) {
- bool[] array = new bool [rawTable.Length];
- foreach (string raw in rawTable)
- array [i++] = (bool) ConvertToObject (raw, type.GetElementType ());
- return array;
- } else if (type == typeof (string[])) {
- string[] array = new string [rawTable.Length];
- foreach (string raw in rawTable)
- array [i++] = (string) ConvertToObject (raw, type.GetElementType ());
- return array;
- } else if (type == typeof (int[])) {
- int[] array = new int [rawTable.Length];
- foreach (string raw in rawTable)
- array [i++] = (int) ConvertToObject (raw, type.GetElementType ());
- return array;
- } else if (type == typeof (uint[])) {
- uint[] array = new uint [rawTable.Length];
- foreach (string raw in rawTable)
- array [i++] = (uint) ConvertToObject (raw, type.GetElementType ());
- return array;
- } else if (type == typeof (DateTime[])) {
- DateTime[] array = new DateTime [rawTable.Length];
- foreach (string raw in rawTable)
- array [i++] = (DateTime) ConvertToObject (raw, type.GetElementType ());
- return array;
- } else
- throw new Exception ("Invalid type");
+ ITaskItem[] items = ConvertToITaskItemArray (project, options);
+
+ Type element_type = type.GetElementType ();
+ Array arr = Array.CreateInstance (element_type, items.Length);
+ for (int i = 0; i < arr.Length; i ++)
+ arr.SetValue (ConvertToObject (items [i].ItemSpec, element_type, options), i);
+ return arr;