using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace IL2CPU.PostAssembler { public class LWAssemblyCollection : IEnumerable { string mAssemblyName; IDictionary methods = new Dictionary(); //lookup Method // List methods = new List(); //if needs to be sorted use a dictionary and list public LWAssemblyCollection(string assemblyName) { mAssemblyName = assemblyName; } public void Add(LWMethod method) { //methods.Add(method); methods.Add(method.Name, method); } //For inlining public void Remove(LWMethod method) { //methods.Remove(method); methods.Remove(method.Name); } public IEnumerator GetEnumerator() { return new LWAssemblyEnumerator(this); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } public IEnumerator MethodEnumerator { get { return methods.Values.GetEnumerator(); } } } }