Ejemplo n.º 1
0
        // Token: 0x06001C36 RID: 7222 RVA: 0x00084A60 File Offset: 0x00082C60
        internal override bool ValidateAndConvertProposedValue(out Collection <BindingExpressionBase.ProposedValue> values)
        {
            values = null;
            object rawProposedValue = this.GetRawProposedValue();

            if (!this.Validate(rawProposedValue, ValidationStep.RawProposedValue))
            {
                return(false);
            }
            object valuesForChildBindings = this.GetValuesForChildBindings(rawProposedValue);

            if (base.IsDetached || valuesForChildBindings == DependencyProperty.UnsetValue || valuesForChildBindings == null)
            {
                return(false);
            }
            int num = this.MutableBindingExpressions.Count;

            object[] array = (object[])valuesForChildBindings;
            if (array.Length < num)
            {
                num = array.Length;
            }
            values = new Collection <BindingExpressionBase.ProposedValue>();
            bool flag = true;

            for (int i = 0; i < num; i++)
            {
                object obj = array[i];
                if (obj != Binding.DoNothing)
                {
                    if (obj == DependencyProperty.UnsetValue)
                    {
                        flag = false;
                    }
                    else
                    {
                        BindingExpressionBase bindingExpressionBase = this.MutableBindingExpressions[i];
                        bindingExpressionBase.Value = obj;
                        if (bindingExpressionBase.NeedsValidation)
                        {
                            Collection <BindingExpressionBase.ProposedValue> collection;
                            bool flag2 = bindingExpressionBase.ValidateAndConvertProposedValue(out collection);
                            if (collection != null)
                            {
                                int j     = 0;
                                int count = collection.Count;
                                while (j < count)
                                {
                                    values.Add(collection[j]);
                                    j++;
                                }
                            }
                            flag = (flag && flag2);
                        }
                    }
                }
            }
            return(flag);
        }
        // Token: 0x06001C81 RID: 7297 RVA: 0x00086020 File Offset: 0x00084220
        internal override bool ValidateAndConvertProposedValue(out Collection <BindingExpressionBase.ProposedValue> values)
        {
            BindingExpressionBase activeBindingExpression = this.ActiveBindingExpression;

            if (activeBindingExpression != null)
            {
                return(activeBindingExpression.ValidateAndConvertProposedValue(out values));
            }
            values = null;
            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get the proposed value(s) that would be written to the source(s), applying
        /// conversion and checking UI-side validation rules.
        /// </summary>
        internal override bool ValidateAndConvertProposedValue(out Collection <ProposedValue> values)
        {
            Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");

            BindingExpressionBase bindExpr = ActiveBindingExpression;

            if (bindExpr != null)
            {
                return(bindExpr.ValidateAndConvertProposedValue(out values));
            }

            values = null;
            return(true);
        }