/// <summary> /// 执行秒表方法 /// </summary> /// <param name="timerID">秒表ID</param> public void OnTimer(int timerID) { if (m_timerID == timerID) { if (m_task != null) { int runningState = m_task.RunningState; if (runningState != m_runningState) { int size = m_task.GetSecurityInfosSize(); int matchCount = m_task.MatchCount; String title = "条件选股"; if (runningState == -1) { if (size > 0) { title += " 符合条件数:(" + matchCount.ToString() + "/" + size.ToString() + ")"; } } else if (runningState == 0) { title += "(正在下载数据...)"; } else { if (size > 0) { title += "(计算中,进度:" + runningState.ToString() + "/" + size.ToString() + ",符合数:" + matchCount.ToString() + ")"; } } if (runningState != m_runningState && runningState == -1) { List <GridColumn> columns = m_gridFilterResult.GetColumns(); GridColumn filterColumn = null; int columnsSize = columns.Count; for (int i = 0; i < columnsSize; i++) { if (columns[i].Name == "FILTER") { filterColumn = columns[i]; break; } } if (filterColumn != null) { m_gridFilterResult.SortColumn(m_gridFilterResult, filterColumn, GridColumnSortMode.Desc); m_gridFilterResult.Update(); } } m_window.Text = title; m_runningState = runningState; m_window.Invalidate(); } } } }