/// ------------------------------------------------------------------------------------
        /// <summary>
        /// Return true if data is OK.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected override bool Verify()
        {
            _textBoxClassName.Text = _textBoxClassName.Text.Trim();

            // Ensure the new class doesn't have an empty class name
            if (_textBoxClassName.Text == string.Empty)
            {
                Utils.MsgBox(LocalizationManager.GetString("DialogBoxes.DefineClassDlg.EmptyClassNameMsg", "Class name must not be empty."));
                return(false);
            }

            if (m_classesDlg == null)
            {
                return(true);
            }

            bool exists = m_classesDlg.ClassListView.DoesClassNameExist(
                _textBoxClassName.Text, m_origClassInfo, true);

            if (exists)
            {
                _textBoxClassName.Focus();
                _textBoxClassName.SelectAll();
            }

            return(!exists);
        }
Exemple #2
0
 /// ------------------------------------------------------------------------------------
 private void HandleWebsiteLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try
     {
         System.Diagnostics.Process.Start("http://phonologyassistant.sil.org");
     }
     catch (Exception err)
     {
         var msg = "The following error occurred when trying to go to the website:\n\n{0}";
         Utils.MsgBox(string.Format(msg, err.Message));
     }
 }
Exemple #3
0
 /// ------------------------------------------------------------------------------------
 private void HandleFeedbackLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try
     {
         System.Diagnostics.Process.Start("mailto:[email protected]?subject=Bug%20Report");
     }
     catch (Exception ex)
     {
         var msg = "There was an error trying to create an e-mail. It's possible a program for sending e-mail has not been installed.\n\n{0}";
         Utils.MsgBox(string.Format(msg, ex.Message));
     }
 }