Beispiel #1
0
        /// <summary>
        /// Helper method which adds all accessibility objects for specified axis
        /// </summary>
        /// <param name="chartAccessibleObject">Chart accessibility object.</param>
        /// <param name="axis">Axis to add accessibility for.</param>
        private void AddAxisAccessibilityObjects(ChartAccessibleObject chartAccessibleObject, Axis axis)
        {
            // Y axis plus title
            if (axis.enabled)
            {
                this._childList.Add(new ChartChildAccessibleObject(
                                        chartAccessibleObject,
                                        this,
                                        axis,
                                        ChartElementType.Axis,
                                        axis.Name,
                                        string.Empty,
                                        AccessibleRole.Graphic));

                if (axis.Title.Length > 0)
                {
                    this._childList.Add(new ChartChildAccessibleObject(
                                            chartAccessibleObject,
                                            this,
                                            axis,
                                            ChartElementType.AxisTitle,
                                            SR.AccessibilityChartAxisTitleName(axis.Name),
                                            axis.Title,
                                            AccessibleRole.StaticText));
                }


                if (axis.MajorGrid.Enabled)
                {
                    this._childList.Add(new ChartChildAccessibleObject(
                                            chartAccessibleObject,
                                            this,
                                            axis.MajorGrid,
                                            ChartElementType.Gridlines,
                                            SR.AccessibilityChartAxisMajorGridlinesName(axis.Name),
                                            string.Empty,
                                            AccessibleRole.Graphic));
                }

                if (axis.MinorGrid.Enabled)
                {
                    this._childList.Add(new ChartChildAccessibleObject(
                                            chartAccessibleObject,
                                            this,
                                            axis.MinorGrid,
                                            ChartElementType.Gridlines,
                                            SR.AccessibilityChartAxisMinorGridlinesName(axis.Name),
                                            string.Empty,
                                            AccessibleRole.Graphic));
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Initializes chart element accessibility object with specified title.
 /// </summary>
 /// <param name="chartAccessibleObject">Chart accessibility object.</param>
 /// <param name="chartAccessibleParentObject">The chart accessible parent object.</param>
 /// <param name="chartChildObject">Chart child object.</param>
 /// <param name="chartChildObjectType">Chart child object type.</param>
 /// <param name="name">Chart child object name.</param>
 /// <param name="objectValue">Chart child object value.</param>
 /// <param name="role">Chart child object role.</param>
 public ChartChildAccessibleObject(
     ChartAccessibleObject chartAccessibleObject,
     AccessibleObject chartAccessibleParentObject,
     object chartChildObject,
     ChartElementType chartChildObjectType,
     string name,
     string objectValue,
     AccessibleRole role)
 {
     this.chartAccessibleObject       = chartAccessibleObject;
     this.chartAccessibleParentObject = chartAccessibleParentObject;
     this.chartChildObject            = chartChildObject;
     this.chartChildObjectType        = chartChildObjectType;
     this.name        = name;
     this.role        = role;
     this.objectValue = objectValue;
 }
Beispiel #3
0
        /// <summary>
        /// Object constructor.
        /// </summary>
        /// <param name="chartAccessibleObject">Chart accessible object.</param>
        /// <param name="series">Chart series object.</param>
        public ChartChildSeriesAccessibleObject(ChartAccessibleObject chartAccessibleObject, AccessibleObject parent, Series series)
            : base(
                chartAccessibleObject,
                parent,
                series, ChartElementType.DataPoint,
                SR.AccessibilitySeriesName(series.Name),
                string.Empty,
                AccessibleRole.Graphic)
        {
            // Add all series data points
            int index = 1;

            foreach (DataPoint point in series.Points)
            {
                this._childList.Add(new ChartChildAccessibleObject(
                                        chartAccessibleObject,
                                        this,
                                        point,
                                        ChartElementType.DataPoint,
                                        SR.AccessibilityDataPointName(index),
                                        string.Empty,
                                        AccessibleRole.Graphic,
                                        series.Name,
                                        index - 1));

                if (point.Label.Length > 0 || point.IsValueShownAsLabel)
                {
                    this._childList.Add(new ChartChildAccessibleObject(
                                            chartAccessibleObject,
                                            this,
                                            point,
                                            ChartElementType.DataPointLabel,
                                            SR.AccessibilityDataPointLabelName(index),
                                            !String.IsNullOrEmpty(point._lastLabelText) ? point._lastLabelText : point.Label,
                                            AccessibleRole.Text,
                                            series.Name,
                                            index - 1));
                }

                ++index;
            }
        }
Beispiel #4
0
 /// <summary>
 /// Initializes chart element accessibility object with specified title.
 /// </summary>
 /// <param name="chartAccessibleObject">Chart accessibility object.</param>
 /// <param name="chartAccessibleParentObject">The chart accessible parent object.</param>
 /// <param name="chartChildObject">Chart child object.</param>
 /// <param name="chartChildObjectType">Chart child object type.</param>
 /// <param name="name">Chart child object name.</param>
 /// <param name="objectValue">Chart child object value.</param>
 /// <param name="role">Chart child object role.</param>
 /// <param name="seriesName">Chart series name.</param>
 /// <param name="pointIndex">Chart data point index.</param>
 public ChartChildAccessibleObject(
     ChartAccessibleObject chartAccessibleObject,
     AccessibleObject chartAccessibleParentObject,
     object chartChildObject,
     ChartElementType chartChildObjectType,
     string name,
     string objectValue,
     AccessibleRole role,
     string seriesName,
     int pointIndex)
 {
     this.chartAccessibleObject       = chartAccessibleObject;
     this.chartAccessibleParentObject = chartAccessibleParentObject;
     this.chartChildObject            = chartChildObject;
     this.chartChildObjectType        = chartChildObjectType;
     this.name           = name;
     this.role           = role;
     this.objectValue    = objectValue;
     this.seriesName     = seriesName;
     this.dataPointIndex = pointIndex;
 }
Beispiel #5
0
        /// <summary>
        /// Object constructor.
        /// </summary>
        /// <param name="chartAccessibleObject">Chart accessible object.</param>
        /// <param name="chartArea">Chart area object.</param>
        public ChartChildChartAreaAccessibleObject(ChartAccessibleObject chartAccessibleObject, ChartArea chartArea)
            : base(
                chartAccessibleObject,
                chartAccessibleObject,
                chartArea, ChartElementType.PlottingArea,
                SR.AccessibilityChartAreaName(chartArea.Name),
                string.Empty,
                AccessibleRole.Graphic)
        {
            // Add all series shown in the chart area
            List <Series> areaSeries = chartArea.GetSeries();

            foreach (Series series in areaSeries)
            {
                this._childList.Add(new ChartChildSeriesAccessibleObject(chartAccessibleObject, this, series));
            }

            // Add all axes
            this.AddAxisAccessibilityObjects(chartAccessibleObject, chartArea.AxisX);
            this.AddAxisAccessibilityObjects(chartAccessibleObject, chartArea.AxisY);
            this.AddAxisAccessibilityObjects(chartAccessibleObject, chartArea.AxisX2);
            this.AddAxisAccessibilityObjects(chartAccessibleObject, chartArea.AxisY2);
        }
Beispiel #6
0
        /// <summary>
        /// Object constructor.
        /// </summary>
        /// <param name="chartAccessibleObject">Chart accessible object.</param>
        /// <param name="legend">Chart legend object.</param>
        public ChartChildLegendAccessibleObject(ChartAccessibleObject chartAccessibleObject, Legend legend)
            : base(
                chartAccessibleObject,
                chartAccessibleObject,
                legend, ChartElementType.LegendArea,
                SR.AccessibilityLegendName(legend.Name),
                string.Empty,
                AccessibleRole.StaticText)
        {
            // Add legend title as a child element
            if (legend.Title.Length > 0)
            {
                this._childList.Add(new ChartChildAccessibleObject(
                                        chartAccessibleObject,
                                        this,
                                        legend, ChartElementType.LegendTitle,
                                        SR.AccessibilityLegendTitleName(legend.Name),
                                        legend.Title,
                                        AccessibleRole.StaticText));
            }

            // NOTE: Legend items are dynamically generated and curently are not part of the list
        }