Exemplo n.º 1
0
        // Token: 0x06001C30 RID: 7216 RVA: 0x000847A0 File Offset: 0x000829A0
        internal override bool ObtainConvertedProposedValue(BindingGroup bindingGroup)
        {
            bool result = true;

            if (base.NeedsUpdate)
            {
                object obj = bindingGroup.GetValue(this);
                if (obj != DependencyProperty.UnsetValue)
                {
                    obj = this.ConvertProposedValue(obj);
                    object[] array;
                    if (obj == DependencyProperty.UnsetValue)
                    {
                        result = false;
                    }
                    else if ((array = (obj as object[])) != null)
                    {
                        for (int i = 0; i < array.Length; i++)
                        {
                            if (array[i] == DependencyProperty.UnsetValue)
                            {
                                result = false;
                            }
                        }
                    }
                }
                this.StoreValueInBindingGroup(obj, bindingGroup);
            }
            else
            {
                bindingGroup.UseSourceValue(this);
            }
            return(result);
        }
Exemplo n.º 2
0
        // Token: 0x06001C32 RID: 7218 RVA: 0x000848B4 File Offset: 0x00082AB4
        internal override bool UpdateSource(BindingGroup bindingGroup)
        {
            bool result = true;

            if (base.NeedsUpdate)
            {
                object value = bindingGroup.GetValue(this);
                this.UpdateSource(value);
                if (value == DependencyProperty.UnsetValue)
                {
                    result = false;
                }
            }
            return(result);
        }
Exemplo n.º 3
0
 // Token: 0x06001C35 RID: 7221 RVA: 0x00084A00 File Offset: 0x00082C00
 internal override bool CheckValidationRules(BindingGroup bindingGroup, ValidationStep validationStep)
 {
     if (!base.NeedsValidation)
     {
         return(true);
     }
     if (validationStep <= ValidationStep.CommittedValue)
     {
         object value = bindingGroup.GetValue(this);
         bool   flag  = this.Validate(value, validationStep);
         if (flag && validationStep == ValidationStep.CommittedValue)
         {
             base.NeedsValidation = false;
         }
         return(flag);
     }
     throw new InvalidOperationException(SR.Get("ValidationRule_UnknownStep", new object[]
     {
         validationStep,
         bindingGroup
     }));
 }
        /// <summary>
        /// Run validation rules for the given step, and inform the binding group
        /// <summary>
        internal override bool CheckValidationRules(BindingGroup bindingGroup, ValidationStep validationStep)
        {
            if (!NeedsValidation)
                return true;

            object value;
            switch (validationStep)
            {
                case ValidationStep.RawProposedValue:
                    value = GetRawProposedValue();
                    break;
                case ValidationStep.ConvertedProposedValue:
                    value = bindingGroup.GetValue(this);
                    break;
                case ValidationStep.UpdatedValue:
                case ValidationStep.CommittedValue:
                    value = this;
                    break;
                default:
                    throw new InvalidOperationException(SR.Get(SRID.ValidationRule_UnknownStep, validationStep, bindingGroup));
            }

            return Validate(value, validationStep);
        }
 /// <summary>
 /// Update the source value and inform the binding group
 /// <summary>
 internal override bool UpdateSource(BindingGroup bindingGroup)
 {
     bool result = true;
     if (NeedsUpdate)
     {
         object value = bindingGroup.GetValue(this);
         value = UpdateSource(value);
         bindingGroup.SetValue(this, value);
         if (value == DependencyProperty.UnsetValue)
         {
             result = false;
         }
     }
     return result;
 }
        /// <summary>
        /// Get the converted proposed value and inform the binding group
        /// <summary>
        internal override bool ObtainConvertedProposedValue(BindingGroup bindingGroup)
        {
            bool result = true;
            object value;

            if (NeedsUpdate)
            {
                value = bindingGroup.GetValue(this);
                if (value != DependencyProperty.UnsetValue)
                {
                    value = ConvertProposedValue(value);
                    if (value == DependencyProperty.UnsetValue)
                    {
                        result = false;
                    }
                }
            }
            else
            {
                value = BindingGroup.DeferredSourceValue;
            }

            bindingGroup.SetValue(this, value);
            return result;
        }
Exemplo n.º 7
0
    /// <summary>
    /// Get the converted proposed value and inform the binding group
    /// <summary>
    internal override bool ObtainConvertedProposedValue(BindingGroup bindingGroup)
    {
        bool result = true;
        if (NeedsUpdate)
        {
            object value = bindingGroup.GetValue(this);
            if (value != DependencyProperty.UnsetValue)
            {
                object[] values;
                value = ConvertProposedValue(value);

                if (value == DependencyProperty.UnsetValue)
                {
                    result = false;
                }
                else if ((values = value as object[]) != null)
                {
                    for (int i=0; i<values.Length; ++i)
                    {
                        if (values[i] == DependencyProperty.UnsetValue)
                        {
                            result = false;
                        }
                    }
                }
            }
            StoreValueInBindingGroup(value, bindingGroup);
        }
        else
        {
            bindingGroup.UseSourceValue(this);
        }

        return result;
    }