void form_Closed(object sender, EventArgs e)
 {
     lock (this)
     {
         if (form.DialogResult == DialogResult.OK)
         {
             SaveText(form.EditText);
         }
         form = null;
     }
 }
        /// <summary>
        /// Called by Paratext when the menu item created for this plugin was clicked.
        /// </summary>
        public void Run(IHost ptHost, string activeProjectName)
        {
            host        = ptHost;
            projectName = activeProjectName;

            Form formToShow;

            lock (this)
            {
                formToShow    = form = new EditTextForm(projectName);
                form.EditText = GetSavedText();
                form.Closed  += form_Closed;
            }
            Application.Run(formToShow);
            Environment.Exit(0);
        }