Beispiel #1
0
        // Token: 0x060039A5 RID: 14757 RVA: 0x0010572C File Offset: 0x0010392C
        private static int GetCleanParentIndex(DependencyObject parent, object collection, out int firstFreeIndex)
        {
            int result = -1;

            firstFreeIndex = -1;
            for (int i = 0; i < TextElementCollectionHelper._cleanParentList.Length; i++)
            {
                if (TextElementCollectionHelper._cleanParentList[i] == null)
                {
                    if (firstFreeIndex == -1)
                    {
                        firstFreeIndex = i;
                    }
                }
                else
                {
                    TextElementCollectionHelper.ParentCollectionPair parentCollectionPair = (TextElementCollectionHelper.ParentCollectionPair)TextElementCollectionHelper._cleanParentList[i].Target;
                    if (parentCollectionPair == null)
                    {
                        TextElementCollectionHelper._cleanParentList[i] = null;
                        if (firstFreeIndex == -1)
                        {
                            firstFreeIndex = i;
                        }
                    }
                    else if (parentCollectionPair.Parent == parent && parentCollectionPair.Collection == collection)
                    {
                        result = i;
                    }
                }
            }
            return(result);
        }
Beispiel #2
0
 // Token: 0x060039A1 RID: 14753 RVA: 0x001055B0 File Offset: 0x001037B0
 internal static void MarkDirty(DependencyObject parent)
 {
     if (parent == null)
     {
         return;
     }
     WeakReference[] cleanParentList = TextElementCollectionHelper._cleanParentList;
     lock (cleanParentList)
     {
         for (int i = 0; i < TextElementCollectionHelper._cleanParentList.Length; i++)
         {
             if (TextElementCollectionHelper._cleanParentList[i] != null)
             {
                 TextElementCollectionHelper.ParentCollectionPair parentCollectionPair = (TextElementCollectionHelper.ParentCollectionPair)TextElementCollectionHelper._cleanParentList[i].Target;
                 if (parentCollectionPair == null || parentCollectionPair.Parent == parent)
                 {
                     TextElementCollectionHelper._cleanParentList[i] = null;
                 }
             }
         }
     }
 }