示例#1
0
        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);
        }
示例#2
0
 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;
 }