/// <summary>
        /// Initializes a new instance of the <see cref="InformationBoxScope"/> class.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        /// <param name="behavior">The behavior.</param>
        public InformationBoxScope(InformationBoxScopeParameters parameters, InformationBoxScopeBehavior behavior)
        {
            _definedParameters = parameters;

            EffectiveParameters = parameters;

            if (behavior == InformationBoxScopeBehavior.INHERITPARENT)
            {
                if (null != Current)
                {
                    // Merge with the parameters defined explicitly in the direct parent
                    EffectiveParameters.Merge(Current._definedParameters);
                }
            }
            else if (behavior == InformationBoxScopeBehavior.INHERITALL)
            {
                if (null != Current)
                {
                    // Merge the effective parameters from the parent
                    EffectiveParameters.Merge(Current.Parameters);
                }
            }

            _scopesStack.Push(this);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InformationBoxScope"/> class.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        /// <param name="behavior">The behavior.</param>
        public InformationBoxScope(InformationBoxScopeParameters parameters, InformationBoxScopeBehavior behavior)
        {
            this.definedParameters   = parameters;
            this.EffectiveParameters = parameters;

            if (null != Current)
            {
                if (behavior == InformationBoxScopeBehavior.InheritParent)
                {
                    // Merge with the parameters defined explicitly in the direct parent
                    this.EffectiveParameters.Merge(Current.definedParameters);
                }
                else if (behavior == InformationBoxScopeBehavior.InheritAll)
                {
                    // Merge the effective parameters from the parent
                    this.EffectiveParameters.Merge(Current.Parameters);
                }

                scopesStack.Push(this);
            }
        }