dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]System.IO.StreamReader lists field Null twice


From: Thomas Lozza
Subject: Re: [DotGNU]System.IO.StreamReader lists field Null twice
Date: Sat, 01 Mar 2003 11:24:29 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204

.. mmhh forgot 'em... sorry.. eventually here they come..

Thomas Lozza wrote:
Hi all
i've got two question concerning System.IO.StreamReader:

(1) Reading the fields via reflection from the StreamReader class, the field Null is listed twice. probabely because StreamReader implements the abstract type System.IO.TextReader which has also a field Null defined. why is that field in TextReader not shadowed??

(2) The attached code fragment does not compile with cscc (problems with namespace reflection... ) .. but the executable (compiled under windows) runs.. why that?

--tom

_______________________________________________
Developers mailing list
address@hidden
http://www.dotgnu.org/mailman/listinfo/developers

class s19d {
        static System.Reflection.FieldInfo[] FA;
        static System.Type T;
        
        public static void Main() {
                System.Console.WriteLine("System.IO.TextReader:");
                T = System.Type.GetType("System.IO.TextReader");
                FA = T.GetFields(
                          System.Reflection.BindingFlags.Public
                        | System.Reflection.BindingFlags.NonPublic
                        | System.Reflection.BindingFlags.Static
                        | System.Reflection.BindingFlags.Instance);
                System.Console.WriteLine("Size={0}",FA.Length);
                foreach(System.Reflection.FieldInfo info in FA) {
                        System.Console.WriteLine("fieldname={0}",info.Name);
                }
                
                
                System.Console.WriteLine("\n\nSystem.IO.StreamReader 
(implements TextReader):");
                T = System.Type.GetType("System.IO.StreamReader");
                FA = T.GetFields(
                          System.Reflection.BindingFlags.Public
                        | System.Reflection.BindingFlags.NonPublic
                        | System.Reflection.BindingFlags.Static
                        | System.Reflection.BindingFlags.Instance);
                System.Console.WriteLine("Size={0}",FA.Length);
                foreach(System.Reflection.FieldInfo info in FA) {
                        System.Console.WriteLine("fieldname={0}",info.Name);
                }
        }
        
}

Attachment: s19d.exe
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]