Search Results

Search found 4 results on 1 pages for 'jamesw'.

Page 1/1 | 1 

  • C# - Get values of static properties from static class

    - by JamesW
    I'm trying to loop through some static properties in a simple static class in order to populate a combo box with their values, but am having difficulties. Here is the simple class: public static MyStaticClass() { public static string property1 = "NumberOne"; public static string property2 = "NumberTwo"; public static string property3 = "NumberThree"; } ... and the code attempting to retrieve the values: Type myType = typeof(MyStaticClass); PropertyInfo[] properties = myType.GetProperties( BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly); foreach (PropertyInfo property in properties) { MyComboBox.Items.Add(property.GetValue(myType, null).ToString()); } If I don't supply any binding flags then I get about 57 properties including things like System.Reflection.Module Module and all sorts of other inherited things I don't care about. My 3 declared properties are not present. If I supply various combinations of other flags then it always returns 0 properties. Great. Does it matter that my static class is actually declared within another non-static class? Please help! What am I doing wrong?

    Read the article

  • Help Me Understand C++ Header files and Classes

    - by JamesW
    OK, So I am trying to transition from intermediate Delphi to C++ Object Oriented programing. I have read Ivar Horton's book on visual C++ 2010. I can pull off the simple console applications no problem. I get the language itself (kinda). Where I am struggling is with headers and classes. I also understand what header files and classes do in general. What I am not getting is the implementation when do I use a header or a class? Do I need to create classes for everything I do? Do my actual work functions need to be in header files or in CPP files? I'm lost on the proper uses of these and could use some real world guidance from more experienced programmers. I am trying to transition to windows applications using the MFC if that is helpful.

    Read the article

  • Regular expression for a list of numbers without other characters

    - by JamesW
    I need a regular expression for a list of numbers in a text box with carriage returns and line feeds, but no other characters. e.g. 1234 5678 5874 3478 I have this: Regex(@"\d\r\n${0,}?"); ... but it is accepting commas when I paste them into my text box: e.g. 1234, 5678 5874, 3478 Can someone please tell me what I'm doing wrong? Thanks

    Read the article

  • Default documentroot apache does not work

    - by James Wise
    I have apache version 2.2 and php 5.3.15 on a single server. I configured virtual hosting and a default vhost. 0_default_.conf - goes to /var/www/default sub.domain.com.conf - goes to /var/www/sub.domain.com My question is, how could I set the default documentroot to sub.domain.com permanently? That means all request should be redirected to sub.domain.com. I try to remove 0_default_.conf but when viewing the page it display the php source code of sub.domain.com. Here is my configurations -- http://pastebin.com/4e3awUJ4 Although I can create index.php to /var/www/default and permanently redirect to sub.domain.com site but it's not viable solution for me because what if I didn't point the ip address of sub.domain.com to the server so user cannot view that subdomain. I would appreciate if anyone could share their knowledge and wisdom. Thanks. JamesW

    Read the article

1