KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to go through all the properties of a type and want to check whether a property type is not a string, how can I do it ? My class is: 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]; // A, R, G, B IsGUIVisible = true; } } the code I am using to check for type is: foreach (var property in typeof(MarkerInfo).GetProperties()) { if (property.PropertyType is typeof(string)) } But this code is not working, any idea how to do that ?
Tags (comma-separated)
Save Edits
Cancel