예제 #1
0
        public ShimReplacement(ShimmedMember parent, Type returnType, bool isPassThrough = false)
        {
            Parent         = parent ?? throw new ArgumentNullException(nameof(parent));
            ReturnType     = returnType ?? throw new ArgumentNullException(nameof(ReturnType));
            IsPassThrough  = isPassThrough;
            HasReturnValue = ShimmedMemberHelper.MemberCanReturn(parent.Member);

            if (HasReturnValue)
            {
                ReturnValue = ShimmedMemberHelper.GetDefaultValue(returnType);
            }
        }
예제 #2
0
 public ShimmedConstructor(ConstructorInfo constructor) : base()
 {
     Init(constructor, constructor.DeclaringType, ShimmedMemberHelper.GetDefaultValue(constructor.DeclaringType));
 }