Ejemplo n.º 1
0
 // Token: 0x060039A2 RID: 14754 RVA: 0x00105630 File Offset: 0x00103830
 internal static void MarkClean(DependencyObject parent, object collection)
 {
     WeakReference[] cleanParentList = TextElementCollectionHelper._cleanParentList;
     lock (cleanParentList)
     {
         int num2;
         int num = TextElementCollectionHelper.GetCleanParentIndex(parent, collection, out num2);
         if (num == -1)
         {
             num = ((num2 >= 0) ? num2 : (TextElementCollectionHelper._cleanParentList.Length - 1));
             TextElementCollectionHelper._cleanParentList[num] = new WeakReference(new TextElementCollectionHelper.ParentCollectionPair(parent, collection));
         }
         TextElementCollectionHelper.TouchCleanParent(num);
     }
 }
Ejemplo n.º 2
0
        // Token: 0x060039A3 RID: 14755 RVA: 0x001056A4 File Offset: 0x001038A4
        internal static bool IsCleanParent(DependencyObject parent, object collection)
        {
            int num = -1;

            WeakReference[] cleanParentList = TextElementCollectionHelper._cleanParentList;
            lock (cleanParentList)
            {
                int num2;
                num = TextElementCollectionHelper.GetCleanParentIndex(parent, collection, out num2);
                if (num >= 0)
                {
                    TextElementCollectionHelper.TouchCleanParent(num);
                }
            }
            return(num >= 0);
        }
 // Sets the element/index cache.
 private void SetCache(int index, TextElementType item)
 {
     _indexCache = new ElementIndexCache(index, item);
     TextElementCollectionHelper.MarkClean(this.Parent, this);
 }
 // True if the cache is reliable.  Otherwise, the tree has been
 // modified and it is not possible to guarantee a valid cache.
 internal bool IsValid(TextElementCollection <TextElementType> collection)
 {
     return(_index >= 0 && TextElementCollectionHelper.IsCleanParent(_element.Parent, collection));
 }