コード例 #1
0
 internal InitialBoilerplateContext(IContextBundle bundle,
                                    IIdentity identity,
                                    IContractBundle contractBundle         = null,
                                    IImmutableQueue <TimeSpan> callTimings = null)
     : base(contractBundle, bundle)
 {
     this.Identity    = identity;
     this.callTimings = callTimings.DefaultIfNull();
 }
コード例 #2
0
        public ContractBundle(IImmutableQueue<IContractCondition> preconditions = null,
                              IImmutableQueue<IContractCondition> postconditionsOnReturn = null,
                              IImmutableQueue<IContractCondition> postconditionsOnThrow = null,
                              IImmutableQueue<Action> instanceValidations = null,
                              int threadCountRestriction = 0,
                              WaitTimeout? threadCountRestrictionTimeout = null,
                              WaitHandle threadWaitHandleSignalRestriction = null,
                              WaitTimeout? threadWaitHandleSignalRestrictionTimeout = null)
        {
            this.Preconditions = preconditions.DefaultIfNull();
            this.PostconditionsOnReturn = postconditionsOnReturn.DefaultIfNull();
            this.PostconditionsOnThrow = postconditionsOnThrow.DefaultIfNull();
            this.InstanceValidations = instanceValidations.DefaultIfNull();
            this.ThreadCountRestriction = threadCountRestriction;
            this.ThreadCountRestrictionTimeout = threadCountRestrictionTimeout.DefaultIfNull();

            //Not defaulting this because null is checked for and verifying a default handle would be confusing to the caller
            this.ThreadWaitHandleSignalRestriction = threadWaitHandleSignalRestriction; 

            this.ThreadWaitHandleSignalRestrictionTimeout = threadWaitHandleSignalRestrictionTimeout.DefaultIfNull();
        }
コード例 #3
0
        public ContractBundle(IImmutableQueue <IContractCondition> preconditions          = null,
                              IImmutableQueue <IContractCondition> postconditionsOnReturn = null,
                              IImmutableQueue <IContractCondition> postconditionsOnThrow  = null,
                              IImmutableQueue <Action> instanceValidations = null,
                              int threadCountRestriction = 0,
                              WaitTimeout?threadCountRestrictionTimeout            = null,
                              WaitHandle threadWaitHandleSignalRestriction         = null,
                              WaitTimeout?threadWaitHandleSignalRestrictionTimeout = null)
        {
            this.Preconditions                 = preconditions.DefaultIfNull();
            this.PostconditionsOnReturn        = postconditionsOnReturn.DefaultIfNull();
            this.PostconditionsOnThrow         = postconditionsOnThrow.DefaultIfNull();
            this.InstanceValidations           = instanceValidations.DefaultIfNull();
            this.ThreadCountRestriction        = threadCountRestriction;
            this.ThreadCountRestrictionTimeout = threadCountRestrictionTimeout.DefaultIfNull();

            //Not defaulting this because null is checked for and verifying a default handle would be confusing to the caller
            this.ThreadWaitHandleSignalRestriction = threadWaitHandleSignalRestriction;

            this.ThreadWaitHandleSignalRestrictionTimeout = threadWaitHandleSignalRestrictionTimeout.DefaultIfNull();
        }