Пример #1
0
        private async void Initialise()
        {
            MessageDialog errorDialog = null;

            try
            {
                await _datasetModel.ReadCsvFile(this.Folder, this.FileName);
            }
            catch (FileNotFoundException ex)
            {
                errorDialog = new MessageDialog(ex.Message);
            }
            catch (Exception ex)
            {
                errorDialog = new MessageDialog(ex.Message);
            }

            if (errorDialog != null)
            {
                await errorDialog.ShowAsync();
            }
            else
            {
                _idIndex = Array.IndexOf(_datasetModel.ColumnHeadings, this.Id);
                for (int i = 0; i < this.Columns.Length; i++)
                {
                    _columnIndexes[i] = Array.IndexOf(_datasetModel.ColumnHeadings, this.Columns[i]);
                }

                if (await _datasetModel.GetAxesMaxMin(this.Columns, _columnIndexes))
                {
                    SetupColumnHeadings();
                }
            }
        }
        private async void Initialise()
        {
            MessageDialog errorDialog = null;

            try
            {
                await _datasetModel.ReadCsvFile(this.Folder, this.FileName);
            }
            catch (FileNotFoundException ex)
            {
                errorDialog = new MessageDialog(ex.Message);
            }
            catch (Exception ex)
            {
                errorDialog = new MessageDialog(ex.Message);
            }

            if (errorDialog != null)
            {
                await errorDialog.ShowAsync();
            }
            else
            {
                // generate property indexes
                _idIndex          = Array.IndexOf(_datasetModel.ColumnHeadings, this.Id);
                _colourValueIndex = Array.IndexOf(_datasetModel.ColumnHeadings, this.ColourValue);

                for (int i = 0; i < this.Axes.Length; i++)
                {
                    _axesIndexes[i] = Array.IndexOf(_datasetModel.ColumnHeadings, this.Axes[i]);
                }

                if (await _datasetModel.GetAxesMaxMin(this.Axes, _axesIndexes))
                {
                    if (await SetupColourComboBoxes())
                    {
                        if (!_datasetModel.IsColourQualitative)
                        {
                            // get colour min max values if sequential
                            if (await _datasetModel.GetColourMaxMin(_colourValueIndex))
                            {
                                SetupAxes();
                            }
                        }
                        else
                        {
                            SetupAxes();
                        }
                    }
                }
            }
        }