Exemple #1
0
 object[]? ITableItemProvider.GetRowHeaderItems()
 => AsArrayOfNativeAccessibles(publicITableItemProvider.GetRowHeaderItems());
 public string [] GetRowHeaderItemPaths()
 {
     return(AutomationBridge.Instance.
            GetElementPaths(provider.GetRowHeaderItems()));
 }
        public void ListItemITableItemProviderTest()
        {
            IRawElementProviderFragmentRoot dataGridProvider;
            IRawElementProviderFragment     child;

            GetDataGridAndFirstListItem(out dataGridProvider, out child);

            ITableProvider tableProvider
                = (ITableProvider)dataGridProvider.GetPatternProvider(
                      TablePatternIdentifiers.Pattern.Id);

            IRawElementProviderSimple[] headerItems
                = tableProvider.GetColumnHeaders();

            SelectionRange range = calendar.GetDisplayRange(false);

            int numChildren = (range.End - range.Start).Days;

            for (int i = 0; i < numChildren && child != null; i++)
            {
                TestProperty(child,
                             AutomationElementIdentifiers.ControlTypeProperty,
                             ControlType.ListItem.Id);

                ITableItemProvider itemProvider = child.GetPatternProvider(
                    TableItemPatternIdentifiers.Pattern.Id) as ITableItemProvider;
                Assert.IsNotNull(itemProvider,
                                 "Does not implement ITableItemProvider");

                // GetColumnHeaderItems
                IRawElementProviderSimple [] itemHeaderItems
                    = itemProvider.GetColumnHeaderItems();

                Assert.IsNotNull(itemHeaderItems,
                                 "No header items returned");
                Assert.AreEqual(1, itemHeaderItems.Length,
                                "Too many or too few header items returned");

                MonthCalendarHeaderItemProvider headerItem
                    = itemHeaderItems[0] as MonthCalendarHeaderItemProvider;

                Assert.IsNotNull(headerItem,
                                 "Header item is not a MonthCalendarHeaderItemProvider");
                Assert.AreEqual(itemProvider.Column, headerItem.Index,
                                "Header item returned does not have the same index as item's column");
                Assert.AreEqual(headerItems[itemProvider.Column], headerItem,
                                "Header item and header item at that index are not equal");

                // GetRowHeaderItems
                IRawElementProviderSimple[] itemRowHeaderItems
                    = itemProvider.GetRowHeaderItems();

                Assert.IsNotNull(itemRowHeaderItems,
                                 "Item provider is returning null for row headers");
                Assert.AreEqual(0, itemRowHeaderItems.Length,
                                "Item provider is returning more than 0 row headers");

                child = ((IRawElementProviderFragment)child)
                        .Navigate(NavigateDirection.NextSibling);
            }
        }