Or just look at this…
Type type = typeof(MyClass); // MyClass is static class with static properties
foreach (var p in type.GetProperties())
{
var v = p.GetValue(null, null); // static classes cannot be instanced, so use null...
}
More Related Contents:
- Can you use reflection to find the name of the currently executing method?
- Open Source Alternatives to Reflector? [closed]
- How to loop through all the properties of a class?
- How to prevent ReflectionTypeLoadException when calling Assembly.GetTypes()
- Is it possible to set private property via reflection?
- Call and Callvirt
- INotifyPropertyChanged property name – hardcode vs reflection?
- Using .Net, how can I determine if a type is a Numeric ValueType?
- How to raise PropertyChanged event without using string name
- Can you get a Func (or similar) from a MethodInfo object?
- Finding the hosting PropertyInfo from the MethodInfo of getter/setter
- How to read assembly attributes
- Getting parent class’ name using Reflection
- In 3 minutes, What is Reflection?
- How to use Reflection to Invoke an Overloaded Method in .NET
- Comparing two collections for equality irrespective of the order of items in them
- Testing if object is of generic type in C#
- How do I set a ViewModel on a window in XAML using DataContext property?
- Change WPF DataTemplate for ListBox item if selected
- Update primary key value using entity framework
- GZip Compression On IIS 7.5 is not working
- How to solve “unable to switch the encoding” error when inserting XML into SQL Server
- How to generate service reference with only physical wsdl file
- Windows or Visual Studio 2022 can’t find the latest installed .NET SDK due to bitness
- C#: how to get an object by the name stored in String?
- What is the difference between Culture and UICulture?
- Dragging an image in WPF
- .NET Date Compare: Count the amount of working days since a date?
- Found conflicts between different versions of the same dependent assembly that could not be resolved
- Reflecting a private field from a base class