Beispiel #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;
 }   
Beispiel #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);
        }
Beispiel #3
0
        public static void MemberCopyTo(object source, object target)
        {
            ModuleCast mc = ModuleCast.GetCast(source.GetType(), target.GetType());

            mc.Cast(source, target);
        }