Exemplo n.º 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);
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Show the replace dialog.
 /// </summary>
 /// <returns>Always returns true.</returns>
 public bool Replace()
 {
     SearchManager.GetInstance().ShowSearchForm(true);
     return true;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Show the find dialog.
 /// </summary>
 /// <returns>Always returns true.</returns>
 public bool Find()
 {
     SearchManager.GetInstance().ShowSearchForm(false);
     return true;
 }