internal void GenerateCreateHashtable(FieldInfo field, Hashtable ht) {
MethodInfo addMethod = typeof(Hashtable).GetMethod("Add", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
Ldthis();
Newobj(typeof(Hashtable).GetConstructor(new Type[0]));
Stfld(field);
IDictionaryEnumerator en = ht.GetEnumerator();
while (en.MoveNext()) {
Ldthisfld(field);
if (en.Key is int) {
Ldc((int) en.Key);
_ilg.Emit(OpCodes.Box, typeof(Int32));
}
else
Ldstr((String) en.Key);
Ldc((int) en.Value);
_ilg.Emit(OpCodes.Box, typeof(Int32));
Callvirt(addMethod);
}
}