User Profile

Collapse

Profile Sidebar

Collapse
ullner
ullner
Last Activity: May 7 '08, 09:06 AM
Joined: Mar 12 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Deserializing an entire XML structure to class instances

    I have an XML fil that looks like this:

    Code:
    <Environment>
        <AreaOfInterest>
          <Name>ScenarioMap</Name>
          <UpperRight>
            <GDC>
              <Latitude>-179</Latitude>
              <Longitude>-179</Longitude>
              <ElevationAGL>0</ElevationAGL>
            </GDC>
          </UpperRight>
    ...
    See more | Go to post

  • ullner
    started a topic Adding two objects to a propertygrid
    in .NET

    Adding two objects to a propertygrid

    I need to add two objects to a PropertyGrid, but when using SelectedObjects , the propertygrid only display those attributes that are common between the two objects. I've looked at CodeProject's examples, but they don't seem to be what I'm after.

    So, how can I merge two objects, or display two at once in a propertygrid? (The objects are two distinct objects, and have no relation, but I want to display and edit all of their attributes...
    See more | Go to post

  • ullner
    replied to Retrieving class attributes and their values
    in .NET
    Thanks. I used your solution (a bit modified);
    Code:
                Type classType = A.GetType();
                PropertyInfo[] a_pi = classType.GetProperties();
                foreach (PropertyInfo pi in a_pi)
                {       
                    Object obj = classType.InvokeMember(null,
                                BindingFlags.DeclaredOnly |
                                BindingFlags.Public | BindingFlags.NonPublic
    ...
    See more | Go to post

    Leave a comment:


  • ullner
    started a topic Retrieving class attributes and their values
    in .NET

    Retrieving class attributes and their values

    I have multiple classes, named A, B and C. I want to get the attributes of all classes and their values. How can I do this?

    I can get the attribute names of (eg) the class "A" by;
    Code:
    Type classType = A.GetType();
    PropertyInfo[] a_pi = classType.GetProperties();
    foreach (PropertyInfo pi in a_pi)
         Console.WriteLine(pi.Name);
    But I'm not able to get their values.
    See more | Go to post
No activity results to display
Show More
Working...