當(dāng)每一次打開或者關(guān)閉SIP時(shí),在SIPEnabledChanged函數(shù)中就會(huì)調(diào)用這段代碼。該函數(shù)的實(shí)現(xiàn)代碼如程序清單4-23所示。
程序清單4-23 對SIP的EnabledChanged事件進(jìn)行響應(yīng)
/// <summary>
/// Respond to the SIP opening or closing
/// </summary>
private void SIPEnabledChanged(object sender, EventArgs e)
{
// Has the input panel enabled state changed to false?
if (_inputPanel != null && _inputPanel.Enabled == false)
{
// The SIP has closed so force a repaint of the whole window.
// Otherwise the SIP imagery is left behind on the screen.
ForceRepaint();
}
}