c# - How to convert chained static class names and a property value to a string? -


context: suppose 1 has following class structure:

public static class somestaticclass {     public static class someinnerstaticclass     {         public static readonly string someproperty = "somestringvalue";     } } 

question:

is there easy way convert reference somestaticclass.someinnerstaticclass.someproperty string value of "somestaticclass.someinnerstaticclass.somestringvalue"?

the first thing posted wrong because static types wrote little code , works.

public static class {     public static class b     {         public static string c         {                         {                 return "hi";             }         }     }  } class program {     static void main( string[] args )     {          console.writeline(typeof(a.b).fullname.replace("+",".") + "." +  a.b.c  ) ;     }   } 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -