コード例 #1
0
 public static object ConvertEnumerableToCollection(object value, string convertToTypeName)
 {
     if (value != null && TypeSystem.ContainsEnumerableInterface(value.GetType()))
     {
         TypeWrapper typeWrapper = new TypeWrapper(convertToTypeName);
         value = TypeSystem.ConvertEnumerableToCollection(value, typeWrapper.Value);
     }
     return(value);
 }
コード例 #2
0
 public static object ConvertEnumerableToCollection(object value, Type convertToType)
 {
     if (value != null && value.GetType() != convertToType && TypeSystem.ContainsEnumerableInterface(value.GetType()))
     {
         object obj = (value as IEnumerable).ConvertTo(convertToType);
         if (obj != null)
         {
             value = obj;
         }
     }
     return(value);
 }
コード例 #3
0
ファイル: EntityUpdate.cs プロジェクト: modulexcite/pash-1
 internal static object ResolveUpdatableObjectList(object list)
 {
     if (list == null || !TypeSystem.ContainsEnumerableInterface(list.GetType()))
     {
         return(list);
     }
     else
     {
         IEnumerable enumerable = list as IEnumerable;
         ArrayList   arrayLists = new ArrayList();
         foreach (object obj in enumerable)
         {
             arrayLists.Add(EntityUpdate.ResolveUpdatableObject(obj));
         }
         return(arrayLists);
     }
 }