コード例 #1
0
        /// <summary>Populate the views series editor with the current selected series.</summary>
        private void PopulateView()
        {
            // Populate the editor with a list of data sources.
            List <string> dataSources = new List <string>();

            foreach (string tableName in storage.TableNames)
            {
                dataSources.Add(tableName);
            }

            dataSources.Sort();
            this.seriesView.DataSource.Values = dataSources.ToArray();

            PopulateMarkerDropDown();
            PopulateLineDropDown();
            PopulateColourDropDown();

            // Populate the checkpoint drop down.
            seriesView.Checkpoint.Values        = storage.Checkpoints().ToArray();
            seriesView.Checkpoint.SelectedValue = series.Checkpoint;

            // Populate line thickness drop down.
            List <string> thicknesses = new List <string>(Enum.GetNames(typeof(LineThicknessType)));

            seriesView.LineThickness.Values        = thicknesses.ToArray();
            seriesView.LineThickness.SelectedValue = series.LineThickness.ToString();

            // Populate marker size drop down.
            List <string> sizes = new List <string>(Enum.GetNames(typeof(MarkerSizeType)));

            seriesView.MarkerSize.Values        = sizes.ToArray();
            seriesView.MarkerSize.SelectedValue = series.MarkerSize.ToString();

            this.seriesView.SeriesType.Values = new string[] { "Scatter", "Bar", "Area" };

            // Populate other controls.
            this.seriesView.SeriesType.SelectedValue            = series.Type.ToString();
            this.seriesView.XOnTop.IsChecked                    = series.XAxis == Axis.AxisType.Top;
            this.seriesView.YOnRight.IsChecked                  = series.YAxis == Axis.AxisType.Right;
            this.seriesView.ShowInLegend.IsChecked              = series.ShowInLegend;
            this.seriesView.IncludeSeriesNameInLegend.IsChecked = series.IncludeSeriesNameInLegend;
            this.seriesView.XCumulative.IsChecked               = series.CumulativeX;
            this.seriesView.YCumulative.IsChecked               = series.Cumulative;
            this.seriesView.DataSource.SelectedValue            = series.TableName;
            this.seriesView.Filter.Value = series.Filter;

            PopulateFieldNames();

            this.seriesView.X.SelectedValue  = series.XFieldName;
            this.seriesView.Y.SelectedValue  = series.YFieldName;
            this.seriesView.X2.SelectedValue = series.X2FieldName;
            this.seriesView.Y2.SelectedValue = series.Y2FieldName;

            this.seriesView.ShowX2Y2(series.Type == SeriesType.Area);
        }