private void PopulateProperties()
        {
#pragma warning disable CA2000 // Properties are disposed in A11yPattern.Dispose()
            this.Properties.Add(new A11yPatternProperty()
            {
                Name = "CurrentView", Value = this.Pattern.CurrentCurrentView
            });
            var array = this.Pattern.GetCurrentSupportedViews();
            if (array.Length > 0)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    var view = (int)array.GetValue(i);
                    Properties.Add(new A11yPatternProperty()
                    {
                        Name = Invariant($"SupportedViews[{i}]"), Value = Invariant($"{view}: {Pattern.GetViewName(view)}")
                    });
                }
            }
#pragma warning restore CA2000 // Properties are disposed in A11yPattern.Dispose()
        }
Esempio n. 2
0
        private void PopulateProperties()
        {
            this.Properties.Add(new A11yPatternProperty()
            {
                Name = "CurrentView", Value = this.Pattern.CurrentCurrentView
            });
            var array = this.Pattern.GetCurrentSupportedViews();

            if (array.Length > 0)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    var view = (int)array.GetValue(i);
                    Properties.Add(new A11yPatternProperty()
                    {
                        Name = Invariant($"SupportedViews[{i}]"), Value = Invariant($"{view}: {Pattern.GetViewName(view)}")
                    });
                }
            }
        }