Ejemplo n.º 1
0
        /// <summary>
        /// Provides a value for UIAutomation's SizeOfSet property
        /// Reads <see cref="AutomationProperties.SizeOfSetProperty"/> and returns the value if one was provided,
        /// otherwise it attempts to calculate one.
        /// </summary>
        override protected int GetSizeOfSetCore()
        {
            int sizeOfSet = AutomationProperties.GetSizeOfSet(_owner);

            if (sizeOfSet == AutomationProperties.AutomationSizeOfSetDefault)
            {
                // If a value has been set for <see cref="UIElement.PositionAndSizeOfSetController"/>
                // forward the call to that element, otherwise return the default value.
                UIElement element = _owner.PositionAndSizeOfSetController;
                if (element != null)
                {
                    AutomationPeer peer = UIElementAutomationPeer.FromElement(element);
                    peer = peer.EventsSource ?? peer;
                    if (peer != null)
                    {
                        try
                        {
                            sizeOfSet = peer.GetSizeOfSet();
                        }
                        catch (ElementNotAvailableException)
                        {
                            sizeOfSet = AutomationProperties.AutomationSizeOfSetDefault;
                        }
                    }
                }
            }

            return(sizeOfSet);
        }
Ejemplo n.º 2
0
        // Token: 0x0600263A RID: 9786 RVA: 0x000B6648 File Offset: 0x000B4848
        protected override int GetSizeOfSetCore()
        {
            AutomationPeer wrapperPeer = this.WrapperPeer;

            if (wrapperPeer != null)
            {
                return(wrapperPeer.GetSizeOfSet());
            }
            this.ThrowElementNotAvailableException();
            return(-1);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the size of a set that contains this DateTime element.
        /// </summary>
        /// <remarks>
        /// Forwards the call to the wrapperPeer.
        /// </remarks>
        /// <returns>
        /// The SizeOfSet property value from the wrapper peer
        /// </returns>
        protected override int GetSizeOfSetCore()
        {
            AutomationPeer wrapperPeer = WrapperPeer;

            if (wrapperPeer != null)
            {
                return(wrapperPeer.GetSizeOfSet());
            }
            else
            {
                ThrowElementNotAvailableException();
            }

            return(AutomationProperties.AutomationSizeOfSetDefault);
        }
        // Token: 0x06002594 RID: 9620 RVA: 0x000B4A68 File Offset: 0x000B2C68
        protected override int GetSizeOfSetCore()
        {
            AutomationPeer owningCellPeer = this.OwningCellPeer;
            int            result         = -1;

            if (owningCellPeer != null)
            {
                result = owningCellPeer.GetSizeOfSet();
            }
            else
            {
                this.ThrowElementNotAvailableException();
            }
            return(result);
        }
        /// <summary>
        /// Gets the size of a set that contains this DataGridCellItem.
        /// </summary>
        /// <remarks>
        /// Forwards the call to the wrapperPeer.
        /// </remarks>
        /// <returns>
        /// The SizeOfSet property value from the wrapper peer
        /// </returns>
        protected override int GetSizeOfSetCore()
        {
            AutomationPeer wrapperPeer = OwningCellPeer;
            int            size        = AutomationProperties.AutomationSizeOfSetDefault;

            if (wrapperPeer != null)
            {
                size = wrapperPeer.GetSizeOfSet();
            }
            else
            {
                ThrowElementNotAvailableException();
            }

            return(size);
        }
Ejemplo n.º 6
0
        // Token: 0x06002713 RID: 10003 RVA: 0x000B8D30 File Offset: 0x000B6F30
        protected override int GetSizeOfSetCore()
        {
            AutomationPeer wrapperPeer = this.GetWrapperPeer();

            if (wrapperPeer != null)
            {
                int num = wrapperPeer.GetSizeOfSet();
                if (num == -1)
                {
                    ItemsControl itemsControl = (ItemsControl)this.ItemsControlAutomationPeer.Owner;
                    num = ItemAutomationPeer.GetSizeOfSetFromItemsControl(itemsControl, this.Item);
                }
                return(num);
            }
            this.ThrowElementNotAvailableException();
            return(-1);
        }
        /// <summary>
        /// Gets the size of a set that contains this item.
        /// </summary>
        /// <remarks>
        /// If <see cref="AutomationProperties.SizeOfSetProperty"/> hasn't been set
        /// this method will calculate the size of the set containing this item based on its parent ItemsControl,
        /// if the ItemsControl is grouping the value will be representative of the group containing this item.
        /// </remarks>
        /// <returns>
        /// The value of <see cref="AutomationProperties.SizeOfSetProperty"/> if it has been set, or the size of the parent ItemsControl or GroupItem.
        /// </returns>
        protected override int GetSizeOfSetCore()
        {
            AutomationPeer wrapperPeer = GetWrapperPeer();

            if (wrapperPeer != null)
            {
                int size = wrapperPeer.GetSizeOfSet();

                if (size == AutomationProperties.AutomationSizeOfSetDefault)
                {
                    ItemsControl parentItemsControl = (ItemsControl)ItemsControlAutomationPeer.Owner;
                    size = GetSizeOfSetFromItemsControl(parentItemsControl, Item);
                }

                return(size);
            }
            else
            {
                ThrowElementNotAvailableException();
            }

            return(AutomationProperties.AutomationSizeOfSetDefault);
        }