/// <summary> /// 切换扫描仪选择时,关闭之前选择的扫描仪。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DataSrc_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (twSession.State >= TwState.OpenDS) { twSession.CloseDS(); } }