Пример #1
0
 public static ModuleCast GetCast(Type sourceType, Type targetType)
 {
     Dictionary<Type, ModuleCast> casts = GetModuleCast(sourceType);
     ModuleCast result;
     lock (casts)
     {
         if (!casts.TryGetValue(targetType, out result))
         {
             result = new ModuleCast(sourceType, targetType);
             casts.Add(targetType, result);
         }
     }
     return result;
 }   
Пример #2
0
        public static ModuleCast GetCast(Type sourceType, Type targetType)
        {
            Dictionary <Type, ModuleCast> casts = GetModuleCast(sourceType);
            ModuleCast result;

            lock (casts)
            {
                if (!casts.TryGetValue(targetType, out result))
                {
                    result = new ModuleCast(sourceType, targetType);
                    casts.Add(targetType, result);
                }
            }
            return(result);
        }
Пример #3
0
        public static void MemberCopyTo(object source, object target)
        {
            ModuleCast mc = ModuleCast.GetCast(source.GetType(), target.GetType());

            mc.Cast(source, target);
        }