From f748be34c13b84913694a03d257bfb6a40584937 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sat, 3 Nov 2012 16:56:51 +0100 Subject: [PATCH] generator: Implement Parameters using the generics class List A first step in the wonderful world of strong-typed collections. We don't need to limit ourselves to the old ways of the .NET 1.1 profile. --- generator/Parameters.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/generator/Parameters.cs b/generator/Parameters.cs index 2fa71ade3..61726d809 100644 --- a/generator/Parameters.cs +++ b/generator/Parameters.cs @@ -24,11 +24,12 @@ namespace GtkSharp.Generation { using System; using System.Collections; + using System.Collections.Generic; using System.Xml; - public class Parameters : IEnumerable { + public class Parameters : IEnumerable { - ArrayList param_list = new ArrayList (); + List param_list = new List (); XmlElement elem; bool first_is_instance; @@ -61,7 +62,7 @@ namespace GtkSharp.Generation { public Parameter this [int idx] { get { - return param_list [idx] as Parameter; + return param_list [idx]; } } @@ -138,11 +139,16 @@ namespace GtkSharp.Generation { param_list = null; } - public IEnumerator GetEnumerator () + public IEnumerator GetEnumerator () { return param_list.GetEnumerator (); } + IEnumerator IEnumerable.GetEnumerator () + { + return GetEnumerator (); + } + bool valid = false; public bool Validate (LogWriter log)