private void RenderOutput(CodeChallengeEventArgs theseArgs) // IEvent thisEvent) { OutputTextBlock.Text = ""; for (int i = 1; i <= 100; i++) { if (i % theseArgs.LowerNumber == 0 && i % theseArgs.UpperNumber != 0) { OutputTextBlock.Text += theseArgs.LowerNumberText; } else if (i % theseArgs.LowerNumber != 0 && i % theseArgs.UpperNumber == 0) { OutputTextBlock.Text += theseArgs.UpperNumberText; } else if (i % theseArgs.LowerNumber == 0 && i % theseArgs.UpperNumber == 0) { OutputTextBlock.Text += theseArgs.CombinedText; } else { OutputTextBlock.Text += i.ToString(); } // Append a line break to the content to prepare for the next line, except when i == 100 if (i != 100) { OutputTextBlock.Text += ", "; } } }
private void EventCreated(object sender, CodeChallengeEventArgs cce) { RenderOutput(cce); }