コード例 #1
0
        // Token: 0x06000C6A RID: 3178 RVA: 0x0002E850 File Offset: 0x0002CA50
        private static void InvalidateResourceReferences(DependencyObject d, ResourcesChangeInfo info)
        {
            LocalValueEnumerator localValueEnumerator = d.GetLocalValueEnumerator();
            int count = localValueEnumerator.Count;

            if (count > 0)
            {
                ResourceReferenceExpression[] array = new ResourceReferenceExpression[count];
                int num = 0;
                while (localValueEnumerator.MoveNext())
                {
                    LocalValueEntry             localValueEntry             = localValueEnumerator.Current;
                    ResourceReferenceExpression resourceReferenceExpression = localValueEntry.Value as ResourceReferenceExpression;
                    if (resourceReferenceExpression != null && info.Contains(resourceReferenceExpression.ResourceKey, false))
                    {
                        array[num] = resourceReferenceExpression;
                        num++;
                    }
                }
                ResourcesChangedEventArgs e = new ResourcesChangedEventArgs(info);
                for (int i = 0; i < num; i++)
                {
                    array[i].InvalidateExpressionValue(d, e);
                }
            }
        }
コード例 #2
0
        /// <summary>
        ///     Determine equality
        /// </summary>
        public override bool Equals(object obj)
        {
            LocalValueEntry other = (LocalValueEntry)obj;

            return(_dp == other._dp &&
                   _value == other._value);
        }
コード例 #3
0
        /// <summary>
        ///     Create a local value enumerator for this instance 
        /// </summary>
        /// <returns>Local value enumerator (stack based)</returns> 
        public LocalValueEnumerator GetLocalValueEnumerator() 
        {
            // Do not allow foreign threads access. 
            // (This is a noop if this object is not assigned to a Dispatcher.)
            //
            this.VerifyAccess();
 
            uint effectiveValuesCount = EffectiveValuesCount;
            LocalValueEntry[] snapshot = new LocalValueEntry[effectiveValuesCount]; 
            int count = 0; 

            // Iterate through the sorted effectiveValues 
            for (uint i=0; i<effectiveValuesCount; i++)
            {
                DependencyProperty dp = DependencyProperty.RegisteredPropertyList.List[_effectiveValues[i].PropertyIndex];
                if (dp != null) 
                {
                    object localValue = ReadLocalValueEntry(new EntryIndex(i), dp, false /* allowDeferredReferences */); 
                    if (localValue != DependencyProperty.UnsetValue) 
                    {
                        snapshot[count++] = new LocalValueEntry(dp, localValue); 
                    }
                }
            }
 
            return new LocalValueEnumerator(snapshot, count);
        } 
コード例 #4
0
ファイル: LocalValueEnumerator.cs プロジェクト: JianwenSun/cc
 internal LocalValueEnumerator(LocalValueEntry[] snapshot, int count)
 {
     _index = -1;
     _count = count;
     _snapshot = snapshot;
 }