コード例 #1
0
        private TReturn GetPrivateField <TReturn>(string fieldname)
        {
            Type         type        = uut.GetType();
            BindingFlags bindingAttr = BindingFlags.NonPublic | BindingFlags.Instance;
            FieldInfo    field       = type.GetField(fieldname, bindingAttr);

            return((TReturn)field.GetValue(uut));
        }