コード例 #1
0
        internal void SetExpressionValue(object value, object baseValue)
        {
            ModifiedValue modifiedValue = this.EnsureModifiedValue();

            modifiedValue.ExpressionValue = value;
            this.IsExpression             = true;
            global::System.Diagnostics.Debug.Assert(object.Equals(baseValue, modifiedValue.BaseValue));
        }
コード例 #2
0
 internal void ResetValue()
 {
     if (this.HasModifiers)
     {
         ModifiedValue modifiedValue = this.ModifiedValue;
         this._source &= FullValueSource.ValueSourceMask;
         this.Value    = modifiedValue.BaseValue;
     }
 }
コード例 #3
0
        internal void SetExpressionFromStyleValue(object value, object baseValue)
        {
            ModifiedValue modifiedValue = this.EnsureModifiedValue();

            global::System.Diagnostics.Debug.Assert(modifiedValue.ExpressionValue == null, "Can't set expression from style if local expression is set");
            modifiedValue.ExpressionValue = value;
            this.IsExpressionFromStyle    = true;
            global::System.Diagnostics.Debug.Assert(object.Equals(baseValue, modifiedValue.BaseValue));
        }
コード例 #4
0
        internal void ResetExpressionFromStyleValue()
        {
            if (this.IsExpressionFromStyle)
            {
                ModifiedValue modifiedValue = this.ModifiedValue;
                modifiedValue.ExpressionValue = null;
                this.IsExpressionFromStyle    = false;

                if (!this.HasModifiers)
                {
                    this.Value = modifiedValue.BaseValue;
                }
            }
        }
コード例 #5
0
        internal void ResetCoercedValue()
        {
            if (this.IsCoerced)
            {
                ModifiedValue modifiedValue = this.ModifiedValue;
                modifiedValue.CoercedValue = null;
                this.IsCoerced             = false;

                if (!this.HasModifiers)
                {
                    this.Value = modifiedValue.BaseValue;
                }
            }
        }
コード例 #6
0
        internal void SetCoercedValue(object value, object baseValue, bool coerceWithCurrentValue)
        {
            ModifiedValue modifiedValue = this.EnsureModifiedValue();

            if (this.IsCoercedWithCurrentValue)
            {
                baseValue = modifiedValue.BaseValue;
            }
            modifiedValue.CoercedValue     = value;
            this.IsCoerced                 = true;
            this.IsCoercedWithCurrentValue = coerceWithCurrentValue;
            global::System.Diagnostics.Debug.Assert(object.Equals(baseValue, modifiedValue.BaseValue) ||
                                                    object.Equals(baseValue, modifiedValue.ExpressionValue));
        }
コード例 #7
0
        private ModifiedValue EnsureModifiedValue()
        {
            ModifiedValue modifiedValue;

            if (this._value == null)
            {
                this._value = modifiedValue = new ModifiedValue();
            }
            else
            {
                modifiedValue = this._value as ModifiedValue;
                if (modifiedValue == null)
                {
                    modifiedValue           = new ModifiedValue();
                    modifiedValue.BaseValue = this._value;
                    this._value             = modifiedValue;
                }
            }
            return(modifiedValue);
        }