<commit_before>using System;
using System.Windows.Forms;
using Palaso.WritingSystems;

namespace Palaso.UI.WindowsForms.WritingSystems
{
	public partial class WSPropertiesDialog : Form
	{
		private readonly WritingSystemSetupPM _model;

		public WSPropertiesDialog()
		{
			InitializeComponent();
			_model = new WritingSystemSetupPM(new LdmlInFolderWritingSystemStore());
			_wsPropertiesPanel.BindToModel(_model);
		}

   /* turned out to be hard... so many events are bound to the model, when the dlg
	* closes we'd need to carefully unsubscribe them alll.
	* Better to try again with a weak event model*/
		/// <summary>
		/// Use this one to keep, say, a picker up to date with any change you make
		/// while using the dialog.
		/// </summary>
		/// <param name="writingSystemModel"></param>
		public WSPropertiesDialog(WritingSystemSetupPM writingSystemModel)
		{
			InitializeComponent();
			_model = writingSystemModel;
			_wsPropertiesPanel.BindToModel(_model);
		}

		public WSPropertiesDialog(string writingSystemStorePath)
		{
			InitializeComponent();
			_model = new WritingSystemSetupPM(new LdmlInFolderWritingSystemStore(writingSystemStorePath));
			_wsPropertiesPanel.BindToModel(_model);
		}

		public DialogResult  ShowDialog(string initiallySelectWritingSystemRfc4646)
		{
			_model.SetCurrentIndexFromRfc46464(initiallySelectWritingSystemRfc4646);
			return ShowDialog();
		}

		private void _closeButton_Click(object sender, EventArgs e)
		{
			try
			{
				_model.Save ();
				Close();
			}
			catch (ArgumentException exception)
			{
				MessageBox.Show (this, exception.Message);
			}
		}

	}<commit_msg>Improve #207 message box for Writing System<commit_after>using System;
using System.Windows.Forms;
using Palaso.WritingSystems;

namespace Palaso.UI.WindowsForms.WritingSystems
{
	public partial class WSPropertiesDialog : Form
	{
		private readonly WritingSystemSetupPM _model;

		public WSPropertiesDialog()
		{
			InitializeComponent();
			_model = new WritingSystemSetupPM(new LdmlInFolderWritingSystemStore());
			_wsPropertiesPanel.BindToModel(_model);
		}

   /* turned out to be hard... so many events are bound to the model, when the dlg
	* closes we'd need to carefully unsubscribe them alll.
	* Better to try again with a weak event model*/
		/// <summary>
		/// Use this one to keep, say, a picker up to date with any change you make
		/// while using the dialog.
		/// </summary>
		/// <param name="writingSystemModel"></param>
		public WSPropertiesDialog(WritingSystemSetupPM writingSystemModel)
		{
			InitializeComponent();
			_model = writingSystemModel;
			_wsPropertiesPanel.BindToModel(_model);
		}

		public WSPropertiesDialog(string writingSystemStorePath)
		{
			InitializeComponent();
			_model = new WritingSystemSetupPM(new LdmlInFolderWritingSystemStore(writingSystemStorePath));
			_wsPropertiesPanel.BindToModel(_model);
		}

		public DialogResult  ShowDialog(string initiallySelectWritingSystemRfc4646)
		{
			_model.SetCurrentIndexFromRfc46464(initiallySelectWritingSystemRfc4646);
			return ShowDialog();
		}

		private void _closeButton_Click(object sender, EventArgs e)
		{
			try
			{
				_model.Save ();
				Close();
			}
			catch (ArgumentException exception)
			{
				MessageBox.Show (
					this, exception.Message, "Writing Systems Error",
					MessageBoxButtons.OK, MessageBoxIcon.Exclamation
				);
			}
		}

	}
{'fraction_non_alphanumeric': 0.08636498077491866, 'fraction_numerical': 0.00857734398107069, 'mean_word_length': 4.251552795031056, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2011089', 'n_tokens_mistral': 1161, 'n_tokens_neox': 968, 'n_words': 251}