Exemple #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
            {
                _latitideIndex     = Array.IndexOf(_datasetModel.ColumnHeadings, this.Latitude);
                _longitudeIndex    = Array.IndexOf(_datasetModel.ColumnHeadings, this.Longitude);
                _placeNameIndex    = Array.IndexOf(_datasetModel.ColumnHeadings, this.PlaceName);
                _symbolSizeIndex   = Array.IndexOf(_datasetModel.ColumnHeadings, this.SymbolSize);
                _symbolColourIndex = Array.IndexOf(_datasetModel.ColumnHeadings, this.SymbolColour);
                _descriptionIndex  = Array.IndexOf(_datasetModel.ColumnHeadings, this.Description);

                if (await SetupColourComboBoxes())
                {
                    if (await CheckSymbolSizeValues())
                    {
                        if (this.LargestBubbleSize != 0)
                        {
                            CalculateScaleFactor();
                        }

                        if (!_datasetModel.IsColourQualitative)
                        {
                            if (await _datasetModel.GetColourMaxMin(_symbolColourIndex))
                            {
                                CreateBubbles();
                            }
                        }
                        else
                        {
                            CreateBubbles();
                        }
                    }
                }
            }
        }
        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();
                        }
                    }
                }
            }
        }
        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
            {
                // create property indexes
                _areasIndex       = Array.IndexOf(_datasetModel.ColumnHeadings, _areas);
                _idIndex          = Array.IndexOf(_datasetModel.ColumnHeadings, _id);
                _descriptionIndex = Array.IndexOf(_datasetModel.ColumnHeadings, _description);
                _hierarchyIndex   = Array.IndexOf(_datasetModel.ColumnHeadings, _hierarchy);
                _colourIndex      = Array.IndexOf(_datasetModel.ColumnHeadings, _colour);

                if (await CheckTreemapAreaValues())
                {
                    if (await SetupColourComboBoxes())
                    {
                        if (!_datasetModel.IsColourQualitative)
                        {
                            if (await _datasetModel.GetColourMaxMin(_colourIndex))
                            {
                                NormaliseValues();
                            }
                        }
                        else
                        {
                            NormaliseValues();
                        }
                    }
                }
            }
        }