// Token: 0x06002AB8 RID: 10936 RVA: 0x000C32D3 File Offset: 0x000C14D3 internal void InvalidateAdorner(AdornerLayer.AdornerInfo adornerInfo) { adornerInfo.Adorner.InvalidateMeasure(); adornerInfo.Adorner.InvalidateVisual(); adornerInfo.RenderSize = new Size(double.NaN, double.NaN); adornerInfo.Transform = null; }
// Token: 0x06002ABD RID: 10941 RVA: 0x000C3428 File Offset: 0x000C1628 private void AddAdornerToVisualTree(AdornerLayer.AdornerInfo adornerInfo, int zOrder) { Adorner adorner = adornerInfo.Adorner; this.AddAdornerInfo(this._zOrderMap, adornerInfo, zOrder); ArrayList arrayList = (ArrayList)this._zOrderMap[zOrder]; if (arrayList.Count > 1) { int num = arrayList.IndexOf(adornerInfo); int index = this._children.IndexOf(((AdornerLayer.AdornerInfo)arrayList[num - 1]).Adorner) + 1; this._children.Insert(index, adorner); return; } IList keyList = this._zOrderMap.GetKeyList(); int num2 = keyList.IndexOf(zOrder) - 1; if (num2 < 0) { this._children.Insert(0, adorner); return; } arrayList = (ArrayList)this._zOrderMap[keyList[num2]]; int index2 = this._children.IndexOf(((AdornerLayer.AdornerInfo)arrayList[arrayList.Count - 1]).Adorner) + 1; this._children.Insert(index2, adorner); }
/// <summary>Positions child elements and determines a size for the <see cref="T:System.Windows.Documents.AdornerLayer" />.</summary> /// <param name="finalSize">The size reserved for this element by its parent.</param> /// <returns>The actual size needed by the element. This return value is typically the same as the value passed to finalSize.</returns> // Token: 0x06002AB6 RID: 10934 RVA: 0x000C3124 File Offset: 0x000C1324 protected override Size ArrangeOverride(Size finalSize) { DictionaryEntry[] array = new DictionaryEntry[this._zOrderMap.Count]; this._zOrderMap.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { ArrayList arrayList = (ArrayList)array[i].Value; int j = 0; while (j < arrayList.Count) { AdornerLayer.AdornerInfo adornerInfo = (AdornerLayer.AdornerInfo)arrayList[j++]; if (!adornerInfo.Adorner.IsArrangeValid) { adornerInfo.Adorner.Arrange(new Rect(default(Point), adornerInfo.Adorner.DesiredSize)); GeneralTransform desiredTransform = adornerInfo.Adorner.GetDesiredTransform(adornerInfo.Transform); GeneralTransform proposedTransform = this.GetProposedTransform(adornerInfo.Adorner, desiredTransform); int num = this._children.IndexOf(adornerInfo.Adorner); if (num >= 0) { Transform adornerTransform = (proposedTransform != null) ? proposedTransform.AffineTransform : null; ((Adorner)this._children[num]).AdornerTransform = adornerTransform; } } if (adornerInfo.Adorner.IsClipEnabled) { adornerInfo.Adorner.AdornerClip = adornerInfo.Clip; } else if (adornerInfo.Adorner.AdornerClip != null) { adornerInfo.Adorner.AdornerClip = null; } } } return(finalSize); }
// Token: 0x06002AB7 RID: 10935 RVA: 0x000C327C File Offset: 0x000C147C internal void Add(Adorner adorner, int zOrder) { if (adorner == null) { throw new ArgumentNullException("adorner"); } AdornerLayer.AdornerInfo adornerInfo = new AdornerLayer.AdornerInfo(adorner); adornerInfo.ZOrder = zOrder; this.AddAdornerInfo(this.ElementMap, adornerInfo, adorner.AdornedElement); this.AddAdornerToVisualTree(adornerInfo, zOrder); base.AddLogicalChild(adorner); this.UpdateAdorner(adorner.AdornedElement); }
// Token: 0x06002AC4 RID: 10948 RVA: 0x000C3938 File Offset: 0x000C1B38 private void AddAdornerInfo(IDictionary infoMap, AdornerLayer.AdornerInfo adornerInfo, object key) { ArrayList arrayList; if (infoMap[key] == null) { arrayList = new ArrayList(1); infoMap[key] = arrayList; } else { arrayList = (ArrayList)infoMap[key]; } arrayList.Add(adornerInfo); }
// Token: 0x06002ABB RID: 10939 RVA: 0x000C33C4 File Offset: 0x000C15C4 internal int GetAdornerZOrder(Adorner adorner) { ArrayList arrayList = this.ElementMap[adorner.AdornedElement] as ArrayList; if (arrayList == null) { throw new InvalidOperationException(SR.Get("AdornedElementNotFound")); } AdornerLayer.AdornerInfo adornerInfo = this.GetAdornerInfo(arrayList, adorner); if (adornerInfo == null) { throw new InvalidOperationException(SR.Get("AdornerNotFound")); } return(adornerInfo.ZOrder); }
// Token: 0x06002ABF RID: 10943 RVA: 0x000C3598 File Offset: 0x000C1798 private void UpdateElementAdorners(UIElement element) { Visual visual = VisualTreeHelper.GetParent(this) as Visual; if (visual == null) { return; } ArrayList arrayList = this.ElementMap[element] as ArrayList; if (arrayList == null) { return; } bool flag = false; GeneralTransform generalTransform = element.TransformToAncestor(visual); for (int i = 0; i < arrayList.Count; i++) { AdornerLayer.AdornerInfo adornerInfo = (AdornerLayer.AdornerInfo)arrayList[i]; Size renderSize = element.RenderSize; Geometry geometry = null; bool flag2 = false; if (adornerInfo.Adorner.IsClipEnabled) { geometry = this.GetClipGeometry(adornerInfo.Adorner.AdornedElement, adornerInfo.Adorner); if ((adornerInfo.Clip == null && geometry != null) || (adornerInfo.Clip != null && geometry == null) || (adornerInfo.Clip != null && geometry != null && adornerInfo.Clip.Bounds != geometry.Bounds)) { flag2 = true; } } if (adornerInfo.Adorner.NeedsUpdate(adornerInfo.RenderSize) || adornerInfo.Transform == null || generalTransform.AffineTransform == null || adornerInfo.Transform.AffineTransform == null || generalTransform.AffineTransform.Value != adornerInfo.Transform.AffineTransform.Value || flag2) { this.InvalidateAdorner(adornerInfo); adornerInfo.RenderSize = renderSize; adornerInfo.Transform = generalTransform; if (adornerInfo.Adorner.IsClipEnabled) { adornerInfo.Clip = geometry; } flag = true; } } if (flag) { base.InvalidateMeasure(); } }
/// <summary>Measures the size required for child elements and determines a size for the <see cref="T:System.Windows.Documents.AdornerLayer" />.</summary> /// <param name="constraint">Unused.</param> /// <returns>This method always returns a <see cref="T:System.Windows.Size" /> of (0,0).</returns> // Token: 0x06002AB5 RID: 10933 RVA: 0x000C30A0 File Offset: 0x000C12A0 protected override Size MeasureOverride(Size constraint) { DictionaryEntry[] array = new DictionaryEntry[this._zOrderMap.Count]; this._zOrderMap.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { ArrayList arrayList = (ArrayList)array[i].Value; int j = 0; while (j < arrayList.Count) { AdornerLayer.AdornerInfo adornerInfo = (AdornerLayer.AdornerInfo)arrayList[j++]; adornerInfo.Adorner.Measure(constraint); } } return(default(Size)); }
// Token: 0x06002AC2 RID: 10946 RVA: 0x000C38B0 File Offset: 0x000C1AB0 private bool RemoveAdornerInfo(IDictionary infoMap, Adorner adorner, object key) { ArrayList arrayList = infoMap[key] as ArrayList; if (arrayList != null) { AdornerLayer.AdornerInfo adornerInfo = this.GetAdornerInfo(arrayList, adorner); if (adornerInfo != null) { arrayList.Remove(adornerInfo); if (arrayList.Count == 0) { infoMap.Remove(key); } return(true); } } return(false); }
// Token: 0x06002ABE RID: 10942 RVA: 0x000C3528 File Offset: 0x000C1728 private void Clear(UIElement element) { if (element == null) { throw new ArgumentNullException("element"); } ArrayList arrayList = this.ElementMap[element] as ArrayList; if (arrayList == null) { throw new InvalidOperationException(SR.Get("AdornedElementNotFound")); } while (arrayList.Count > 0) { AdornerLayer.AdornerInfo adornerInfo = arrayList[0] as AdornerLayer.AdornerInfo; this.Remove(adornerInfo.Adorner); } this.ElementMap.Remove(element); }
// Token: 0x06002ABA RID: 10938 RVA: 0x000C3328 File Offset: 0x000C1528 internal void SetAdornerZOrder(Adorner adorner, int zOrder) { ArrayList arrayList = this.ElementMap[adorner.AdornedElement] as ArrayList; if (arrayList == null) { throw new InvalidOperationException(SR.Get("AdornedElementNotFound")); } AdornerLayer.AdornerInfo adornerInfo = this.GetAdornerInfo(arrayList, adorner); if (adornerInfo == null) { throw new InvalidOperationException(SR.Get("AdornerNotFound")); } this.RemoveAdornerInfo(this._zOrderMap, adorner, adornerInfo.ZOrder); this._children.Remove(adorner); adornerInfo.ZOrder = zOrder; this.AddAdornerToVisualTree(adornerInfo, zOrder); this.InvalidateAdorner(adornerInfo); this.UpdateAdorner(adorner.AdornedElement); }
/// <summary>Removes the specified <see cref="T:System.Windows.Documents.Adorner" /> from the adorner layer.</summary> /// <param name="adorner">The <see cref="T:System.Windows.Documents.Adorner" /> to remove.</param> /// <exception cref="T:System.ArgumentNullException">Raised when adorner is null.</exception> // Token: 0x06002AAC RID: 10924 RVA: 0x000C2DA8 File Offset: 0x000C0FA8 public void Remove(Adorner adorner) { if (adorner == null) { throw new ArgumentNullException("adorner"); } ArrayList arrayList = this.ElementMap[adorner.AdornedElement] as ArrayList; if (arrayList == null) { return; } AdornerLayer.AdornerInfo adornerInfo = this.GetAdornerInfo(arrayList, adorner); if (adornerInfo == null) { return; } this.RemoveAdornerInfo(this.ElementMap, adorner, adorner.AdornedElement); this.RemoveAdornerInfo(this._zOrderMap, adorner, adornerInfo.ZOrder); this._children.Remove(adorner); base.RemoveLogicalChild(adorner); }