示例#1
0
        private void showForm()
        {
            using (var cfgForm = new API_Form())
            {
                var result = cfgForm.ShowDialog();

                if (result != DialogResult.OK)
                {
                    return;
                }

                apiKey = Properties.Settings.Default.ApiKey;
            }
        }
示例#2
0
        private string getAPIKey()
        {
            if (string.IsNullOrWhiteSpace(apiKey))
            {
                using (var cfgForm = new API_Form())
                {
                    var result = cfgForm.ShowDialog();

                    if (result != DialogResult.OK)
                    {
                        return(null);
                    }

                    apiKey = Properties.Settings.Default.ApiKey;
                }
            }

            return(apiKey);
        }