Esempio n. 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);
        }
Esempio n. 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;
 }