generator: Implement Parameters using the generics class List<T>

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.
This commit is contained in:
Bertrand Lorentz 2012-11-03 16:56:51 +01:00
parent d467cce6e6
commit f748be34c1

View file

@ -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<Parameter> {
ArrayList param_list = new ArrayList ();
List<Parameter> param_list = new List<Parameter> ();
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<Parameter> GetEnumerator ()
{
return param_list.GetEnumerator ();
}
IEnumerator IEnumerable.GetEnumerator ()
{
return GetEnumerator ();
}
bool valid = false;
public bool Validate (LogWriter log)