private void LoadSettings(RegexSettings logSettings)
 {
     txtbDirectory.Text       = Settings.Directory;
     txtbOpenFileFilters.Text = Settings.FileOpenDialogFilters;
     txtbSupportedFiles.Text  = string.Join(";", Settings.SupportFormats.ToList());
     lstbRegularExpressions.Items.Clear();
     lstbRegularExpressions.Items.AddRange(Settings.RegexPatterns.ToArray());
     txtbSupportedFiles.Text = string.Join(";", logSettings.SupportFormats);
 }
        private void btnImport_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter      = "Analogy Regex Settings (*.regexsettings)|*.regexsettings";
            openFileDialog1.Title       = @"Import Regex settings";
            openFileDialog1.Multiselect = true;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    var           json     = File.ReadAllText(openFileDialog1.FileName);
                    RegexSettings settings = JsonConvert.DeserializeObject <RegexSettings>(json);
                    LoadSettings(settings);
                    MessageBox.Show("File Imported. Save settings if desired", @"Import settings", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error Import: " + ex.Message, @"Error Import file", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }