// Token: 0x06007C73 RID: 31859 RVA: 0x0022FF34 File Offset: 0x0022E134
        public void UpdateComponentZOrder(IAnnotationComponent component)
        {
            Invariant.Assert(component != null, "null component");
            int componentLevel = AdornerPresentationContext.GetComponentLevel(component);
            AnnotationAdorner annotationAdorner = this.FindAnnotationAdorner(component);

            if (annotationAdorner == null)
            {
                return;
            }
            this._adornerLayer.SetAdornerZOrder(annotationAdorner, AdornerPresentationContext.ComponentToAdorner(component.ZOrder, componentLevel));
            List <AnnotationAdorner> topAnnotationAdorners = this.GetTopAnnotationAdorners(componentLevel, component);

            if (topAnnotationAdorners == null)
            {
                return;
            }
            int num = component.ZOrder + 1;

            foreach (AnnotationAdorner annotationAdorner2 in topAnnotationAdorners)
            {
                annotationAdorner2.AnnotationComponent.ZOrder = num;
                this._adornerLayer.SetAdornerZOrder(annotationAdorner2, AdornerPresentationContext.ComponentToAdorner(num, componentLevel));
                num++;
            }
        }
        // Token: 0x06007C6E RID: 31854 RVA: 0x0022FEB8 File Offset: 0x0022E0B8
        public override void SendToBack(IAnnotationComponent component)
        {
            AnnotationAdorner annotationAdorner = this.GetAnnotationAdorner(component);
            int componentLevel = AdornerPresentationContext.GetComponentLevel(component);

            if (component.ZOrder != 0)
            {
                component.ZOrder = 0;
                this.UpdateComponentZOrder(component);
            }
        }
        // Token: 0x06007C6D RID: 31853 RVA: 0x0022FE64 File Offset: 0x0022E064
        public override void BringToFront(IAnnotationComponent component)
        {
            AnnotationAdorner annotationAdorner = this.GetAnnotationAdorner(component);
            int componentLevel = AdornerPresentationContext.GetComponentLevel(component);
            int nextZOrder     = AdornerPresentationContext.GetNextZOrder(this._adornerLayer, componentLevel);

            if (nextZOrder != component.ZOrder + 1)
            {
                component.ZOrder = nextZOrder;
                this._adornerLayer.SetAdornerZOrder(annotationAdorner, AdornerPresentationContext.ComponentToAdorner(component.ZOrder, componentLevel));
            }
        }
        // Token: 0x06007C65 RID: 31845 RVA: 0x0022FC4C File Offset: 0x0022DE4C
        internal static void HostComponent(AdornerLayer adornerLayer, IAnnotationComponent component, UIElement annotatedElement, bool reorder)
        {
            AnnotationAdorner annotationAdorner = new AnnotationAdorner(component, annotatedElement);

            annotationAdorner.AnnotationComponent.PresentationContext = new AdornerPresentationContext(adornerLayer, annotationAdorner);
            int componentLevel = AdornerPresentationContext.GetComponentLevel(component);

            if (reorder)
            {
                component.ZOrder = AdornerPresentationContext.GetNextZOrder(adornerLayer, componentLevel);
            }
            adornerLayer.Add(annotationAdorner, AdornerPresentationContext.ComponentToAdorner(component.ZOrder, componentLevel));
        }
        // Token: 0x06007C79 RID: 31865 RVA: 0x0023013C File Offset: 0x0022E33C
        private static int GetNextZOrder(AdornerLayer adornerLayer, int level)
        {
            Invariant.Assert(adornerLayer != null, "null adornerLayer");
            int num           = 0;
            int childrenCount = VisualTreeHelper.GetChildrenCount(adornerLayer);

            if (childrenCount == 0)
            {
                return(num);
            }
            for (int i = 0; i < childrenCount; i++)
            {
                DependencyObject  child             = VisualTreeHelper.GetChild(adornerLayer, i);
                AnnotationAdorner annotationAdorner = child as AnnotationAdorner;
                if (annotationAdorner != null && AdornerPresentationContext.GetComponentLevel(annotationAdorner.AnnotationComponent) == level && annotationAdorner.AnnotationComponent.ZOrder >= num)
                {
                    num = annotationAdorner.AnnotationComponent.ZOrder + 1;
                }
            }
            return(num);
        }
        // Token: 0x06007C77 RID: 31863 RVA: 0x0023006C File Offset: 0x0022E26C
        private List <AnnotationAdorner> GetTopAnnotationAdorners(int level, IAnnotationComponent component)
        {
            List <AnnotationAdorner> list = new List <AnnotationAdorner>();
            int childrenCount             = VisualTreeHelper.GetChildrenCount(this._adornerLayer);

            if (childrenCount == 0)
            {
                return(list);
            }
            for (int i = 0; i < childrenCount; i++)
            {
                DependencyObject  child             = VisualTreeHelper.GetChild(this._adornerLayer, i);
                AnnotationAdorner annotationAdorner = child as AnnotationAdorner;
                if (annotationAdorner != null)
                {
                    IAnnotationComponent annotationComponent = annotationAdorner.AnnotationComponent;
                    if (annotationComponent != component && AdornerPresentationContext.GetComponentLevel(annotationComponent) == level && annotationComponent.ZOrder >= component.ZOrder)
                    {
                        this.AddAdorner(list, annotationAdorner);
                    }
                }
            }
            return(list);
        }