private void OnFormClosing(object sender, FormClosingEventArgs e) { if (DocPagesContainer.TabPages.Count == 0) { e.Cancel = false; } else { e.Cancel = true; if (message_box("All unsaved data will be lost!\nAre you sure?", "Exit " + CONST_EDITOR_NAME, System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { e.Cancel = false; } } if (!e.Cancel) { destroy(); if (py_api_doc.is_active()) { m_py_api_doc.Close(); m_py_api_doc = null; } } }
public py_api_doc(string _api_doc_str, Icon _icon, string _title) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); // // TODO: Add constructor code after the InitializeComponent() call. // if (m_instance == null) { m_instance = this; } this.Icon = _icon; this.Text = _title; try { // check if browser component exists HTMLBrowser.Refresh(); } catch (Exception /*_err*/) { this.Controls.Remove(HTMLBrowser); this.Text = "Ooops!.. It seems like you need to install 'libgluezilla' to view the in-app document or try to select 'In-Browser Doc' option or press F1"; return; } this.HTMLBrowser.DocumentText = _api_doc_str; }
void InAppDocToolStripMenuItemClick(object sender, EventArgs e) { if (!py_api_doc.is_active()) { m_py_api_doc = new py_api_doc(m_api_doc_str, this.Icon, m_api_doc_title); m_py_api_doc.Show(); } py_api_doc.set_focus(); }
void OnFormClosed(object sender, FormClosedEventArgs e) { if (this.HTMLBrowser != null) { this.HTMLBrowser.DocumentText = null; } if (m_instance == this) { m_instance = null; } }