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

C#

 
GeneralRe: ListView.Items.ContainsKey ?? Pin
student_rhr7-May-06 10:08
student_rhr7-May-06 10:08 
QuestionReflection Problem ! Pin
User 20930737-May-06 6:35
User 20930737-May-06 6:35 
AnswerRe: Reflection Problem ! Pin
rudy.net7-May-06 7:23
rudy.net7-May-06 7:23 
GeneralRe: Reflection Problem ! Pin
User 20930737-May-06 18:26
User 20930737-May-06 18:26 
AnswerRe: Reflection Problem ! Pin
Stefan Troschuetz7-May-06 7:32
Stefan Troschuetz7-May-06 7:32 
GeneralRe: Reflection Problem ! Pin
S. Senthil Kumar7-May-06 7:39
S. Senthil Kumar7-May-06 7:39 
GeneralRe: Reflection Problem ! Pin
Stefan Troschuetz7-May-06 8:12
Stefan Troschuetz7-May-06 8:12 
AnswerRe: Reflection Problem ! Pin
S. Senthil Kumar7-May-06 7:36
S. Senthil Kumar7-May-06 7:36 
You simply have to call GetProperty again for IntVar, this time on pInfo.PropertyType. That will get you a reference to IntVar's property info, which you can then use to call SetValue. Just remember to call SetValue on pInfo again, as the struct instance you have is a boxed instance and setting it's member values will not affect the original struct.
object o = Activator.CreateInstance(typeof(MyClass));
            PropertyInfo structPropertyInfo = typeof(MyClass).GetProperty("StructVar");
            object s = structPropertyInfo.GetValue(o, null);
            PropertyInfo intPropertyInfo = structPropertyInfo.PropertyType.GetProperty("IntVar");
            intPropertyInfo.SetValue(s, 2, null);
            structPropertyInfo.SetValue(o, s, null);
            MyClass a = (MyClass)o;
            Console.WriteLine(a.StructVar.IntVar);


Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
GeneralRe: Reflection Problem ! Pin
User 20930737-May-06 20:55
User 20930737-May-06 20:55 
Questioninsert into error Pin
Susuko7-May-06 5:52
Susuko7-May-06 5:52 
AnswerRe: insert into error Pin
Shajeel7-May-06 22:06
Shajeel7-May-06 22:06 
GeneralRe: insert into error Pin
Susuko8-May-06 10:18
Susuko8-May-06 10:18 
QuestionFiltering records in a DataGrid Pin
ventomito7-May-06 4:08
ventomito7-May-06 4:08 
AnswerRe: Filtering records in a DataGrid Pin
rudy.net7-May-06 4:30
rudy.net7-May-06 4:30 
GeneralRe: Filtering records in a DataGrid Pin
ventomito7-May-06 5:07
ventomito7-May-06 5:07 
GeneralRe: Filtering records in a DataGrid Pin
Sean897-May-06 5:32
Sean897-May-06 5:32 
GeneralRe: Filtering records in a DataGrid Pin
ventomito7-May-06 5:53
ventomito7-May-06 5:53 
GeneralRe: Filtering records in a DataGrid Pin
Sean897-May-06 6:01
Sean897-May-06 6:01 
GeneralRe: Filtering records in a DataGrid Pin
ventomito7-May-06 6:50
ventomito7-May-06 6:50 
GeneralRe: Filtering records in a DataGrid Pin
Sean897-May-06 7:24
Sean897-May-06 7:24 
Questionwhy does my application flicker??!!! Pin
Susuko7-May-06 1:26
Susuko7-May-06 1:26 
AnswerRe: why does my application flicker??!!! Pin
Christian Graus7-May-06 1:32
protectorChristian Graus7-May-06 1:32 
QuestionDataGrid problem Pin
narendrakumarp7-May-06 0:19
narendrakumarp7-May-06 0:19 
AnswerRe: DataGrid problem Pin
Robert Rohde7-May-06 3:01
Robert Rohde7-May-06 3:01 
QuestionListing Project Forms Pin
freshonlineMax6-May-06 23:15
freshonlineMax6-May-06 23: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.