コード例 #1
0
        // Token: 0x06001C86 RID: 7302 RVA: 0x000860FC File Offset: 0x000842FC
        private void ChooseActiveBindingExpression(DependencyObject target)
        {
            int count = this.MutableBindingExpressions.Count;
            int i;

            for (i = 0; i < count; i++)
            {
                BindingExpressionBase bindingExpressionBase = this.MutableBindingExpressions[i];
                if (bindingExpressionBase.StatusInternal == BindingStatusInternal.Inactive)
                {
                    bindingExpressionBase.Activate();
                }
                if (bindingExpressionBase.StatusInternal == BindingStatusInternal.Active || bindingExpressionBase.UsingFallbackValue)
                {
                    break;
                }
            }
            int num = (i < count) ? i : -1;

            if (num != this._activeIndex)
            {
                int activeIndex = this._activeIndex;
                this._activeIndex = num;
                base.AdoptProperties(this.ActiveBindingExpression);
                WeakDependencySource[] newSources = BindingExpressionBase.CombineSources(-1, this.MutableBindingExpressions, this.AttentiveBindingExpressions, null, null);
                base.ChangeSources(newSources);
                if (num != -1)
                {
                    for (i = activeIndex; i > num; i--)
                    {
                        this.MutableBindingExpressions[i].Deactivate();
                    }
                }
            }
        }
コード例 #2
0
        // Token: 0x06001C75 RID: 7285 RVA: 0x00085E14 File Offset: 0x00084014
        internal override void ChangeSourcesForChild(BindingExpressionBase bindingExpression, WeakDependencySource[] newSources)
        {
            int num = this.MutableBindingExpressions.IndexOf(bindingExpression);

            if (num >= 0)
            {
                WeakDependencySource[] newSources2 = BindingExpressionBase.CombineSources(num, this.MutableBindingExpressions, this.AttentiveBindingExpressions, newSources, null);
                base.ChangeSources(newSources2);
            }
        }
コード例 #3
0
        // Token: 0x06001C2A RID: 7210 RVA: 0x0008438C File Offset: 0x0008258C
        internal override void ChangeSourcesForChild(BindingExpressionBase bindingExpression, WeakDependencySource[] newSources)
        {
            int num = this.MutableBindingExpressions.IndexOf(bindingExpression);

            if (num >= 0)
            {
                WeakDependencySource[] commonSources = null;
                if (base.UsesLanguage)
                {
                    commonSources = new WeakDependencySource[]
                    {
                        new WeakDependencySource(base.TargetElement, FrameworkElement.LanguageProperty)
                    };
                }
                WeakDependencySource[] newSources2 = BindingExpressionBase.CombineSources(num, this.MutableBindingExpressions, this.MutableBindingExpressions.Count, newSources, commonSources);
                base.ChangeSources(newSources2);
            }
        }
コード例 #4
0
        // Token: 0x06001C23 RID: 7203 RVA: 0x00083FF4 File Offset: 0x000821F4
        private void AttachToContext(bool lastChance)
        {
            DependencyObject targetElement = base.TargetElement;

            if (targetElement == null)
            {
                return;
            }
            bool flag = TraceData.IsExtendedTraceEnabled(this, TraceDataLevel.Attach);

            this._converter = this.ParentMultiBinding.Converter;
            if (this._converter == null && string.IsNullOrEmpty(base.EffectiveStringFormat))
            {
                TraceData.Trace(TraceEventType.Error, TraceData.MultiBindingHasNoConverter, this.ParentMultiBinding);
            }
            if (flag)
            {
                TraceData.Trace(TraceEventType.Warning, TraceData.AttachToContext(new object[]
                {
                    TraceData.Identify(this),
                    lastChance ? " (last chance)" : string.Empty
                }));
            }
            base.TransferIsDeferred = true;
            bool flag2 = true;
            int  count = this.MutableBindingExpressions.Count;

            for (int i = 0; i < count; i++)
            {
                if (this.MutableBindingExpressions[i].StatusInternal == BindingStatusInternal.Unattached)
                {
                    flag2 = false;
                }
            }
            if (!flag2 && !lastChance)
            {
                if (flag)
                {
                    TraceData.Trace(TraceEventType.Warning, TraceData.ChildNotAttached(new object[]
                    {
                        TraceData.Identify(this)
                    }));
                }
                return;
            }
            if (base.UsesLanguage)
            {
                WeakDependencySource[] commonSources = new WeakDependencySource[]
                {
                    new WeakDependencySource(base.TargetElement, FrameworkElement.LanguageProperty)
                };
                WeakDependencySource[] newSources = BindingExpressionBase.CombineSources(-1, this.MutableBindingExpressions, this.MutableBindingExpressions.Count, null, commonSources);
                base.ChangeSources(newSources);
            }
            bool   flag3 = base.IsOneWayToSource;
            object newValue;

            if (base.ShouldUpdateWithCurrentValue(targetElement, out newValue))
            {
                flag3 = true;
                base.ChangeValue(newValue, false);
                base.NeedsUpdate = true;
            }
            base.SetStatus(BindingStatusInternal.Active);
            if (!flag3)
            {
                this.UpdateTarget(false);
                return;
            }
            base.UpdateValue();
        }