private void Compare(Lottery lottery) { lt_CompareTwos.Clear(); AnalyzeTendency at = new AnalyzeTendency(); CompareTwoModel tm; for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--) { tm = new CompareTwoModel(); tm.Sno = (lottery.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0'); tm.Lottery = lottery.Lt_Lotterys[i].Lottery; tm.CompareValue = at.CompareLottery(lottery.Lt_Lotterys, i, index1, index2); tm.Dtime = lottery.Lt_Lotterys[i].Dtime; lt_CompareTwos.Add(tm);//添加趋势记录 } int pre = lt_CompareTwos.Count - 1; for (int i = lt_CompareTwos.Count - 1; i >= 1; i--) { tm = lt_CompareTwos[i]; if (tm.CompareValue == 0) { tm.TendencyValue = 0; } else { for (int j = i - 1; j >= 0; j--) { if (lt_CompareTwos[j].CompareValue == 0) { tm.TendencyValue = i - j; break; } } } } }