/// override protected bool IsOffscreenCore() { IsOffscreenBehavior behavior = AutomationProperties.GetIsOffscreenBehavior(_owner); switch (behavior) { case IsOffscreenBehavior.Onscreen: return(false); case IsOffscreenBehavior.Offscreen: return(true); case IsOffscreenBehavior.FromClip: { bool isOffscreen = !_owner.IsVisible; if (!isOffscreen) { Rect boundingRect = CalculateVisibleBoundingRect(_owner); isOffscreen = (DoubleUtil.AreClose(boundingRect, Rect.Empty) || DoubleUtil.AreClose(boundingRect.Height, 0) || DoubleUtil.AreClose(boundingRect.Width, 0)); } return(isOffscreen); } default: return(!_owner.IsVisible); } }
/// <summary> /// <see cref="AutomationPeer.IsOffscreenCore"/> /// </summary> /// <returns></returns> protected override bool IsOffscreenCore() { IsOffscreenBehavior behavior = AutomationProperties.GetIsOffscreenBehavior(Owner); switch (behavior) { case IsOffscreenBehavior.Onscreen: return(false); case IsOffscreenBehavior.Offscreen: return(true); default: { TextElement textElement = (TextElement)Owner; ITextView textView = textElement.TextContainer.TextView; if (textView == null || !textView.IsValid || (!textView.Contains(textElement.ContentStart) && !textView.Contains(textElement.ContentEnd))) { return(true); } if (CalculateVisibleRect(textView, textElement, textElement.ContentStart, textElement.ContentEnd) == Rect.Empty) { return(true); } return(false); } } }
/// <summary> /// Helper for setting IsOffscreenBehavior property on a DependencyObject. /// </summary> public static void SetIsOffscreenBehavior(DependencyObject element, IsOffscreenBehavior value) { if (element == null) { throw new ArgumentNullException("element"); } element.SetValue(IsOffscreenBehaviorProperty, value); }
/// <summary> /// Helper for setting IsOffscreenBehavior property on a StyledElement. /// </summary> public static void SetIsOffscreenBehavior(StyledElement element, IsOffscreenBehavior value) { if (element == null) { throw new ArgumentNullException(nameof(element)); } element.SetValue(IsOffscreenBehaviorProperty, value); }
/// <summary> /// <see cref="AutomationPeer.IsOffscreenCore"/> /// </summary> override protected bool IsOffscreenCore() { IsOffscreenBehavior behavior = AutomationProperties.GetIsOffscreenBehavior(_owner); switch (behavior) { case IsOffscreenBehavior.Onscreen: return(false); default: return(true); } }
/// <summary>Gets a value that indicates whether the <see cref="T:System.Windows.FrameworkContentElement" /> that is associated with this <see cref="T:System.Windows.Automation.Peers.DocumentAutomationPeer" /> is off the screen. This method is called by <see cref="M:System.Windows.Automation.Peers.AutomationPeer.IsOffscreen" />.</summary> /// <returns> /// <see langword="true" /> if the element is not on the screen; otherwise, <see langword="false" />.</returns> // Token: 0x06002661 RID: 9825 RVA: 0x000B6E24 File Offset: 0x000B5024 protected override bool IsOffscreenCore() { IsOffscreenBehavior isOffscreenBehavior = AutomationProperties.GetIsOffscreenBehavior(base.Owner); if (isOffscreenBehavior == IsOffscreenBehavior.Onscreen) { return(false); } if (isOffscreenBehavior != IsOffscreenBehavior.Offscreen) { UIElement uielement; Rect rect = this.CalculateBoundingRect(true, out uielement); return(DoubleUtil.AreClose(rect, Rect.Empty) || uielement == null); } return(true); }
/// <summary>Gets a value that indicates whether <see cref="T:System.Windows.Documents.TextElement" /> that is associated with this <see cref="T:System.Windows.Automation.Peers.TextElementAutomationPeer" /> is off of the screen. Called by <see cref="M:System.Windows.Automation.Peers.AutomationPeer.IsOffscreen" />.</summary> /// <returns> /// <see langword="true" /> if the element is not on the screen; otherwise, <see langword="false" />.</returns> // Token: 0x0600284D RID: 10317 RVA: 0x000BC0FC File Offset: 0x000BA2FC protected override bool IsOffscreenCore() { IsOffscreenBehavior isOffscreenBehavior = AutomationProperties.GetIsOffscreenBehavior(base.Owner); if (isOffscreenBehavior == IsOffscreenBehavior.Onscreen) { return(false); } if (isOffscreenBehavior != IsOffscreenBehavior.Offscreen) { TextElement textElement = (TextElement)base.Owner; ITextView textView = textElement.TextContainer.TextView; return(textView == null || !textView.IsValid || (!textView.Contains(textElement.ContentStart) && !textView.Contains(textElement.ContentEnd)) || this.CalculateVisibleRect(textView, textElement, textElement.ContentStart, textElement.ContentEnd) == Rect.Empty); } return(true); }
/// <summary> /// <see cref="AutomationPeer.IsOffscreenCore"/> /// </summary> protected override bool IsOffscreenCore() { IsOffscreenBehavior behavior = AutomationProperties.GetIsOffscreenBehavior(Owner); switch (behavior) { case IsOffscreenBehavior.Onscreen: return(false); case IsOffscreenBehavior.Offscreen: return(true); default: { UIElement uiScope; Rect boundingRect = CalculateBoundingRect(true, out uiScope); return(DoubleUtil.AreClose(boundingRect, Rect.Empty) || uiScope == null); } } }
/// protected override bool IsOffscreenCore() { IsOffscreenBehavior behavior = AutomationProperties.GetIsOffscreenBehavior(_owner); switch (behavior) { case IsOffscreenBehavior.Onscreen : return false; case IsOffscreenBehavior.Offscreen : return true; case IsOffscreenBehavior.FromClip: { bool isOffscreen = !_owner.IsVisible; if (!isOffscreen) { UIElement containingUIElement = GetContainingUIElement(_owner); if (containingUIElement != null) { Rect boundingRect = UIElementAutomationPeer.CalculateVisibleBoundingRect(containingUIElement); isOffscreen = (DoubleUtil.AreClose(boundingRect, Rect.Empty) || DoubleUtil.AreClose(boundingRect.Height, 0) || DoubleUtil.AreClose(boundingRect.Width, 0)); } } return isOffscreen; } default : return !_owner.IsVisible; } }