I want to view all the properties of a type and want to check if the property type is not a string, how can I do this?
My class:
public class MarkerInfo
{
public string Name { get; set; }
public byte[] Color { get; set; }
public TypeId Type { get; set; }
public bool IsGUIVisible { get; set; }
public MarkerInfo()
{
Color = new byte[4];
IsGUIVisible = true;
}
}
and the code that I use for type checking is:
foreach (var property in typeof(MarkerInfo).GetProperties())
{
if (property.PropertyType is typeof(string))
}
But this code does not work, any idea how to do this?
source
share