C# get object property name
using System.Reflection; // reflection namespace
// get all public static properties of MyClass type
PropertyInfo[] propertyInfos;
propertyInfos = typeof(MyClass).GetProperties(BindingFlags.Public |
BindingFlags.Static);
// sort properties by name
Array.Sort(propertyInfos,
delegate(PropertyInfo propertyInfo1, PropertyInfo propertyInfo2)
{ return propertyInfo1.Name.CompareTo(propertyInfo2.Name); });
// write property names
foreach (PropertyInfo propertyInfo in propertyInfos)
{
Console.WriteLine(propertyInfo.Name);
}
Also in C#:
- unity html request
- unity create primitive
- unity prevent system from creation
- unity how to make a ui disappear
- c# return multiple value unity
- top down movement unity
- unity resources load
- how to draw a dot in c#
- move towards target unity
- how to add a componet to a gameobject throgh code unity
- how to work with ascii in c#
- if get key down unity
- c# try catch error
- how to go to other forms in C#
- c# new list object
- check if enabled unity
- unity deactive code from code
- add text to combobox c#
- pop up element from specific index in array
- visual studio C# hintergrund bild ändern
- unity quaternion identity
- Rigidbody.addforce
- convert array object to int[] c#
- unity move character