public DisplayOne() { InitializeComponent(); MsgList list = MsgList.Instance(); showId.Text = list.showID(0); showSen.Text = list.showSender(0); showSub.Text = list.showSub(0); showCon.Text = list.showCon(0); }
//METHOD FOR PREVIOUS BUTTON CLICK, RETREIVES PREVIOUS MESSAGE IN LIST. private void prev_Click(object sender, RoutedEventArgs e) { MsgList list = MsgList.Instance(); int max = list.getSize() - 1; if (current == 0) { current = max; showId.Text = list.showID(current); showSen.Text = list.showSender(current); showSub.Text = list.showSub(current); showCon.Text = list.showCon(current); } else { showId.Text = list.showID(current - 1); showSen.Text = list.showSender(current - 1); showSub.Text = list.showSub(current - 1); showCon.Text = list.showCon(current - 1); current--; } }
//METHOD FOR NEXT BUTTON CLICK, RETRIEVES NEXT MESSAGE IN LIST. private void next_Click(object sender, RoutedEventArgs e) { MsgList list = MsgList.Instance(); int max = list.getSize() - 1; if (current != max) { showId.Text = list.showID(current + 1); showSen.Text = list.showSender(current + 1); showSub.Text = list.showSub(current + 1); showCon.Text = list.showCon(current + 1); current++; } else { current = 0; showId.Text = list.showID(current); showSen.Text = list.showSender(current); showSub.Text = list.showSub(current); showCon.Text = list.showCon(current); } }
public DisplayAll() { InitializeComponent(); //METHOD FOR DISPLAYING MESSAGES. MsgList list = MsgList.Instance(); int size = list.getSize(); for (int i = 0; i < size; i++) { string message = "Message ID:" + list.showID(i) + " Sender: " + list.showSender(i) + " Subject: " + list.showSub(i) + " Content: " + list.showCon(i); messageView.Items.Add(message); } }