<commit_before>﻿using System.Collections.Generic;
using System.Linq;
using System.Windows.Automation;
using System.Windows.Automation.Provider;
using UIA.Extensions.AutomationProviders.Interfaces.Tables;

namespace UIA.Extensions.AutomationProviders.Tables
{
    public class TableProvider : ControlProvider, ITableProvider
    {
        private readonly TableInformation _tableInformation;

        public TableProvider(TableInformation tableInformation) : base(tableInformation.Control)
        {
            _tableInformation = tableInformation;
            SetPropertyValue(AutomationElementIdentifiers.ControlTypeProperty.Id, ControlType.Table.Id);
            SetPropertyValue(AutomationElementIdentifiers.LocalizedControlTypeProperty.Id, ControlType.Table.LocalizedControlType);
        }

        public int RowCount { get { return _tableInformation.RowCount; } }
        public int ColumnCount { get { return _tableInformation.ColumnCount; } }

        private ChildProvider _headerProvider;
        private ChildProvider HeaderProvider
        {
            get
            {
                var currentHeader = new HeaderProvider(this, _tableInformation.Headers);
                if (!Equals(_headerProvider, currentHeader))
                {
                    _headerProvider = currentHeader;
                }

                return _headerProvider;<commit_msg>fix broken tests around lazily loaded headers<commit_after>﻿using System.Collections.Generic;
using System.Linq;
using System.Windows.Automation;
using System.Windows.Automation.Provider;
using UIA.Extensions.AutomationProviders.Interfaces.Tables;

namespace UIA.Extensions.AutomationProviders.Tables
{
    public class TableProvider : ControlProvider, ITableProvider
    {
        private readonly TableInformation _tableInformation;

        public TableProvider(TableInformation tableInformation) : base(tableInformation.Control)
        {
            _tableInformation = tableInformation;
            SetPropertyValue(AutomationElementIdentifiers.ControlTypeProperty.Id, ControlType.Table.Id);
            SetPropertyValue(AutomationElementIdentifiers.LocalizedControlTypeProperty.Id, ControlType.Table.LocalizedControlType);
        }

        public int RowCount { get { return _tableInformation.RowCount; } }
        public int ColumnCount { get { return _tableInformation.ColumnCount; } }

        private ChildProvider _headerProvider;
        private ChildProvider HeaderProvider
        {
            get
            {
                var currentHeader = new HeaderProvider(this, _tableInformation.Headers);
                if (HasHeaders && !Equals(_headerProvider, currentHeader))
                {
                    _headerProvider = currentHeader;
                }

                return _headerProvider;
{'fraction_non_alphanumeric': 0.06285714285714286, 'fraction_numerical': 0.0, 'mean_word_length': 2.906555090655509, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3401493', 'n_tokens_mistral': 643, 'n_tokens_neox': 623, 'n_words': 130}