/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the tooltip that shows the checking error comment. /// </summary> /// ------------------------------------------------------------------------------------ private void HandleToolTip() { if (m_mouseOverCell == null || !IsRowIgnoredWithAnnotation(m_mouseOverCell.RowIndex)) { HideToolTip(); return; } CheckingError error = m_list[m_mouseOverCell.RowIndex] as CheckingError; // If the context menu is showing, we don't want to bring up the tooltip. TMItemProperties itemProps = m_tmAdapter.GetItemProperties("cmnuStatusIgnored"); if (itemProps != null && itemProps.IsDisplayed) return; Form frm = FindForm(); if (frm != null && !frm.ContainsFocus) return; if (Columns[m_mouseOverCell.ColumnIndex].DataPropertyName != "Status") HideToolTip(); else { if (m_commentToolTip == null) { m_commentToolTip = new CommentToolTip(m_styleSheet); m_commentToolTip.Closed += m_commentToolTip_Closed; m_commentToolTip.Opened += m_commentToolTip_Opened; m_commentToolTip.TimerTick += m_commentToolTip_TimerTick; } m_toolTipCell = this[m_mouseOverCell.ColumnIndex, m_mouseOverCell.RowIndex]; m_commentToolTip.Show(error.MyNote.ResolutionOA, this[m_mouseOverCell.ColumnIndex, m_mouseOverCell.RowIndex]); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Releases unmanaged and - optionally - managed resources /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; /// <c>false</c> to release only unmanaged resources.</param> /// ------------------------------------------------------------------------------------ protected override void Dispose(bool disposing) { if (disposing && !IsDisposed) { ResetFonts(); if (m_commentToolTip != null) m_commentToolTip.Dispose(); if (m_detailsColFonts != null) { foreach (KeyValuePair<int, Font> kvp in m_detailsColFonts) kvp.Value.Dispose(); m_detailsColFonts.Clear(); } m_charChkResultToolTip.Dispose(); } m_detailsColFonts = null; m_commentToolTip = null; m_list = null; base.Dispose(disposing); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Releases unmanaged and - optionally - managed resources /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; /// <c>false</c> to release only unmanaged resources.</param> /// ------------------------------------------------------------------------------------ protected override void Dispose(bool disposing) { if (disposing) { ResetFonts(); if (m_commentToolTip != null) m_commentToolTip.Dispose(); } m_commentToolTip = null; m_list = null; base.Dispose(disposing); }