示例#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 void MemberCopyTo(object source, object target)
        {
            ModuleCast mc = ModuleCast.GetCast(source.GetType(), target.GetType());

            mc.Cast(source, target);
        }