Example #1
0
        private void reloadMappingButton_Click(object sender, EventArgs e)
        {
            var mappingRemoteUrl = _mappingRemoteUrlTextBoxWrapper.GetText();

            var result = MessageBox.Show($@"Do you really want to reload mapping from: <{mappingRemoteUrl}>?", @"Reload mapping?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

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

            Uri uri;

            try
            {
                uri = ConvertUtils.ToUri(mappingRemoteUrl);
            }
            catch (Exception)
            {
                return;
            }

            try
            {
                SettingsParser.DownloadRemoteMapping(uri);
                Logger.InfoBox($"Mapping successfully reloaded from: {uri}");
            }
            catch (Exception)
            {
                Logger.Error($"cannot reload mapping by remote URL: \"{uri}\".", null, true);
            }
        }