private int getSustain(CorrectionStatus status) { var sustain = 0; var cache = 0; for (int i = 0; i < ActiveSheet.Answers.Count; i++) { var item = ActiveSheet.Answers.ElementAt(i); if (item.Status == status) { cache += 1; } else { if (cache > sustain) { sustain = cache; } cache = 0; } if (i == ActiveSheet.Answers.Count - 1) { if (cache > sustain) { sustain = cache; } } } return(sustain); }
protected string StatusToGlyph(CorrectionStatus status) { var glyph = ""; switch (status) { case CorrectionStatus.False: glyph = ""; break; case CorrectionStatus.True: glyph = ""; break; } return(glyph); }
protected SolidColorBrush StatusToBrush(CorrectionStatus status) { var color = noColor; switch (status) { case CorrectionStatus.False: color = falseColor; break; case CorrectionStatus.True: color = trueColor; break; } return(color); }