I could find the AddField method in class.cs. I just put a simple "hello" output statement in the AddField method but that was not printed on the console. Who calls the AddField method ?
Marek Safar wrote: > Hi, >> I am using the following code to access the variables of class >> compiled by mcs but I get no output on the console. >> >> > It depends when you are accessing those fields, but they should be > available for most of compilation time. > > Look how it works in TypeContainer::AddField (FieldBase field) > >> ArrayList ad = new ArrayList(); >> ad.Add(tc.Fields); >> String[] ia = (String[])ad.ToArray(typeof(String)); >> Console.WriteLine(ia[0]); >> for (int k = 0; k < ia.Length; k++) >> Console.WriteLine("ia.count"+ia.Length+ia.GetValue(k)); >> >> what is the reason for tc.Fields not having any values ? >> > This code does not make a sense. TypeContainer::Fields returns a > collection and you are adding this collection into another collection > and then expecting to get string values, isn't that strange? > > Marek > >> Marek Safar wrote: >> >>> Hi, >>> >>>> I am trying to find out what variables were contained in the c# >>>> file parsed by mcs. I am looking in RootContext.cs where the whole >>>> structure is created but I am unable to access the variables of the >>>> class. >>>> Any help appreciated. >>>> >>>> >>> I don't know what information you need but type fields are stored in >>> TypeContainer::Fields >>> >>> Marek >>> >>> >> _______________________________________________ >> Mono-devel-list mailing list >> Mono-devel-list@lists.ximian.com >> http://lists.ximian.com/mailman/listinfo/mono-devel-list >> >> > > _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list