public List <ScriptProperty> GetScriptProperties(object obj) { var result = new List <ScriptProperty>(); try { var props = obj.GetType().GetProperties(); foreach (var prop in props) { var sp = new ScriptProperty(); sp.Name = prop.Name; sp.Type = prop.PropertyType; sp.Value = prop.GetValue(obj); result.Add(sp); } } catch { } return(result); }
public List<ScriptProperty> GetScriptProperties(object obj) { var result = new List<ScriptProperty>(); try { var props = obj.GetType().GetProperties(); foreach(var prop in props) { var sp = new ScriptProperty(); sp.Name = prop.Name; sp.Type = prop.PropertyType; sp.Value = prop.GetValue(obj); result.Add(sp); } } catch { } return result; }