当每一次打开或者关闭SIP时,在SIPEnabledChanged函数中就会调用这段代码。该函数的实现代码如程序清单4-23所示。
程序清单4-23 对SIP的EnabledChanged事件进行响应
/// <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();
}
}