http://bugzilla.novell.com/show_bug.cgi?id=522303
User [email protected] added comment http://bugzilla.novell.com/show_bug.cgi?id=522303#c1 Elise Langham <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Elise Langham <[email protected]> 2009-07-15 08:38:15 MDT --- Essential for using .NET Generic Collections Copy of TestArrays.cs file: ------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; using System.Reflection; namespace TestArrayLengths { public static class MyStringUtil { public static int Max(ICollection<int> list) { int max = Int32.MinValue; foreach (int item in list) { max = Math.Max(max, item); } return max; } public static ICollection<int> ArrayLengths(ICollection<Array> arrayList) { int[] lengths = new int[arrayList.Count]; int i = 0; foreach (Array a in arrayList) { lengths[i++] = a.Length; } return lengths; } } class Program { static void Main(string[] args) { ////create array of arrays of strings string[][] lines = new string[5][]; lines[0] = new string[2]; lines[1] = new string[] { " " }; lines[2] = new string[2]; lines[3] = new string[] { " " }; lines[4] = new string[2]; lines[0][0] = "Parameter"; lines[0][1] = "---------"; lines[2][0] = "Provided"; lines[2][1] = "--------"; lines[4][0] = "Expected"; lines[4][1] = "--------"; int nRows = MyStringUtil.Max(MyStringUtil.ArrayLengths(lines)); Console.WriteLine("value of nRows: {0}", nRows); } } } ------------------------------------------------------------------------------ -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
