Click here to Skip to main content
15,890,947 members
Home / Discussions / C#
   

C#

 
GeneralScroll To Caret For exterior TextBox Scrolling Pin
SubterII10-Feb-05 13:35
SubterII10-Feb-05 13:35 
GeneralRe: Scroll To Caret For exterior TextBox Scrolling Pin
Dave Kreskowiak11-Feb-05 3:59
mveDave Kreskowiak11-Feb-05 3:59 
GeneralPlaying wav sounds in a .NET Web App Pin
Anonymous10-Feb-05 13:29
Anonymous10-Feb-05 13:29 
GeneralRe: Playing wav sounds in a .NET Web App Pin
Christian Graus10-Feb-05 14:22
protectorChristian Graus10-Feb-05 14:22 
GeneralRe: Playing wav sounds in a .NET Web App Pin
Dave Kreskowiak11-Feb-05 3:54
mveDave Kreskowiak11-Feb-05 3:54 
GeneralRe: Playing wav sounds in a .NET Web App Pin
Christian Graus13-Feb-05 19:28
protectorChristian Graus13-Feb-05 19:28 
GeneralRe: Playing wav sounds in a .NET Web App Pin
Dave Kreskowiak11-Feb-05 3:53
mveDave Kreskowiak11-Feb-05 3:53 
GeneralBuilding a treeview from an object graph (reflection) Pin
Rein Petersen10-Feb-05 11:19
Rein Petersen10-Feb-05 11:19 
Hi all,

I'm toying with reflection to try and build a recursive function that generates treenodes of a treeview that represent any given object's graph (of child objects):

public TreeNode BuildNode(ref object o)
{
TreeNode tn;
treenode.Tag = o;
treenode.Text = typeof(o).Name;

if (typeof(o).GetInterface("System.IEnumerable",true))
foreach (object c in o)
tn.Nodes.Add(BuildNode(ref c));
else
foreach(MemberInfo m in typeof(o).GetProperties(BindingFlags.Public))
tn.Add(BuildNode(ref m.???); // << Trouble here ...
// I really just want access
// to the property from the
// MemberInfo object...
return tn;
}

As you can see, it almost works except I have no way of accessing an [un?]boxed object's property. I know from reflecting the object's type that it has the property, but have no way of accessing the property (in a generic manner) without hardcoding my object types into a bunch of overloads of 'BuildNode', or having some way-huge switch.

Looking for advice, pointers to documents, creative ideas, etc. that might get me closer to a solution.



Thanks for all your help,

Rein
GeneralFile Compression Pin
Shady Aly10-Feb-05 10:58
Shady Aly10-Feb-05 10:58 
GeneralRe: File Compression Pin
therealmccoy10-Feb-05 11:19
therealmccoy10-Feb-05 11:19 
GeneralRe: File Compression Pin
mikker_12310-Feb-05 15:43
mikker_12310-Feb-05 15:43 
Generalstatic constructors Pin
Yaakov Davis10-Feb-05 8:57
Yaakov Davis10-Feb-05 8:57 
GeneralRe: static constructors Pin
Dave Kreskowiak10-Feb-05 9:07
mveDave Kreskowiak10-Feb-05 9:07 
GeneralRe: static constructors Pin
Yaakov Davis10-Feb-05 10:09
Yaakov Davis10-Feb-05 10:09 
GeneralRe: static constructors Pin
S. Senthil Kumar10-Feb-05 9:59
S. Senthil Kumar10-Feb-05 9:59 
GeneralSplit app.msi into multiple msi and install-on-demand Pin
Ruchi Gupta10-Feb-05 8:51
Ruchi Gupta10-Feb-05 8:51 
Generaldetecting IE close event Pin
Adnan Siddiqi10-Feb-05 8:50
Adnan Siddiqi10-Feb-05 8:50 
GeneralListView BeforeSelect Pin
stoked10-Feb-05 8:36
stoked10-Feb-05 8:36 
Generalunique identifier on a thread Pin
sameerhanda10-Feb-05 8:30
sameerhanda10-Feb-05 8:30 
GeneralRe: unique identifier on a thread Pin
C# Genius10-Feb-05 8:44
C# Genius10-Feb-05 8:44 
GeneralRe: unique identifier on a thread Pin
Dave Kreskowiak10-Feb-05 9:02
mveDave Kreskowiak10-Feb-05 9:02 
GeneralRe: unique identifier on a thread Pin
Stefan Troschuetz11-Feb-05 0:18
Stefan Troschuetz11-Feb-05 0:18 
GeneralClient/Server Pin
Soumya Mulukutla10-Feb-05 6:58
Soumya Mulukutla10-Feb-05 6:58 
GeneralRe: Client/Server Pin
Michael P Butler10-Feb-05 8:15
Michael P Butler10-Feb-05 8:15 
GeneralRe: Client/Server Pin
S. Senthil Kumar10-Feb-05 8:15
S. Senthil Kumar10-Feb-05 8:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.