Exemple #1
0
        /// <summary>
        /// Get a reference to the SearchManager singleton.
        /// </summary>
        /// <returns>A reference to the SearchManager.</returns>
        public static SearchManager GetInstance()
        {
            if (_singleton == null)
            {
                _singleton = new SearchManager();
            }

            return(_singleton);
        }
        protected void ScintillaEditForm_FormClosing(
            object sender, FormClosingEventArgs e)
        {
            SearchManager.GetInstance().HideSearchForm();

            if (scintilla.Modified)
            {
                DialogResult res = MessageBox.Show(String.Format(
                        Resources.SaveChangesMessage,
                        documentFileName),
                    Resources.SaveChangesTitle,
                    MessageBoxButtons.YesNoCancel,
                    MessageBoxIcon.Warning);

                if (res == DialogResult.Cancel)
                    e.Cancel = true;
                else if (res == DialogResult.Yes)
                    e.Cancel = !SaveDocument();
            }
        }
 /// <summary>
 /// Show the replace dialog.
 /// </summary>
 /// <returns>Always returns true.</returns>
 public bool Replace()
 {
     SearchManager.GetInstance().ShowSearchForm(true);
     return true;
 }
 /// <summary>
 /// Show the find dialog.
 /// </summary>
 /// <returns>Always returns true.</returns>
 public bool Find()
 {
     SearchManager.GetInstance().ShowSearchForm(false);
     return true;
 }