Ejemplo n.º 1
0
        /// <summary>
        /// Binds the form's database drop down to the list of available databases for the
        /// current connection.
        /// </summary>
        public async Task BindInfluxDataSources()
        {
            try
            {
                // No database assigned
                if (string.IsNullOrWhiteSpace(Database))
                {
                    return;
                }

                // Display database name in UI
                databaseValue.Text = Database;

                // Clear the current list of measurements and reload
                destinationComboBox.Items.Clear();
                sourceComboBox.Items.Clear();
                var measurementNames = await InfluxDbClient.GetMeasurementNamesAsync(Database);

                foreach (var measurement in measurementNames)
                {
                    destinationComboBox.Items.Add(measurement);
                    sourceComboBox.Items.Add(measurement);
                }

                destinationComboBox.SelectedItem = null;
                sourceComboBox.SelectedItem      = null;
            }
            catch (Exception ex)
            {
                AppForm.DisplayException(ex);
            }
        }