Asked • 07/16/19

C# class within a class (or nesting)?

Hey all I have made the following class: public class ssrsFormats { public static readonly string pdf = "PDF", mhtml = "MHTML", html4 = "HTML4.0", html3 = "HTML3.2", excel1 = "EXCELOPENXML", excel2 = "EXCEL", word1 = "WORDOPENXML", word2 = "WORD", csv = "CSV", xml = "XML", image = "IMAGE"; } And what I am wondering is how (if) I can do something like so: ssrsFormats.image.jpeg I only want to do this so I have a type of **"intellisense"** in order to help me build the function call when it comes to that. Instead of me trying to remember the image formats within the SSRS formats class, I start typing **ssrsformats.image.** and it pops up the image formats for me to pick from. I am trying to also do this **within one class** instead of having multiple classes that point to other classes.

1 Expert Answer


Ken G. answered • 12/20/19

Chief Software Engineere

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.