473,396 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

reflection omits private members.

hi i have a class in which i have some private and some public members.
using reflection i iterate thru the memebers but i dont get the private ones
.. i only get the public ones. how do i get the private ones. thanx
Jul 21 '05 #1
2 2312
hi i got it.
MethodInfo methodInfo in
type.GetMethods(BindingFlags.NonPublic|BindingFlag s.Instance)
gets the private members as well , but how do i see the public and private
members together. ?
or how do i concatenate them ?
thnx

"frazer" <ic***@hotmail.com> wrote in message
news:ew**************@TK2MSFTNGP10.phx.gbl...
hi i have a class in which i have some private and some public members.
using reflection i iterate thru the memebers but i dont get the private ones . i only get the public ones. how do i get the private ones. thanx

Jul 21 '05 #2
frazer <ic***@hotmail.com> wrote:
MethodInfo methodInfo in
type.GetMethods(BindingFlags.NonPublic|BindingFlag s.Instance)
gets the private members as well , but how do i see the public and private
members together. ?
or how do i concatenate them ?


Use

type.GetMethods
(BindingFlags.NonPublic|BindingFlags.Instance|Bind ingFlags.Public)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
8
by: paccala | last post by:
Ciao Being google-ing since hours and still I'm not able to solve my problem... I have following hierarchy: class A { public void myMethod(); }
0
by: Cat | last post by:
I have class Base, and class Derived. I am serializing Derived objects from XML, and these Derived objects are allowed to 'inherit' the values from other named Base objects already defined in...
2
by: tolisss | last post by:
Hi could someone explain to me why the followind code fails using System; using System.Collections; using System.Reflection; using MbUnit.Core.Framework; using MbUnit.Framework; namespace...
8
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. ...
11
by: Opa | last post by:
Hi, I'm trying to get some private class members using reflection, but am having trouble: Example using System; using System.Reflection; public class Customer {
6
by: Ken Varn | last post by:
I have an ASP.NET application that is calling a custom class that is trying to parse all of the members of my Page object using Type.GetMembers(). The problem that I am having is that private...
2
by: frazer | last post by:
hi i have a class in which i have some private and some public members. using reflection i iterate thru the memebers but i dont get the private ones .. i only get the public ones. how do i get the...
0
by: liko81 | last post by:
I have an Invoice class that must know, directly or indirectly, how to do anything associated with creating, reading, or otherwise processing an invoice to a customer. It is an uber-DAO object that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.