예제 #1
0
        private void UpdateMessageDetails()
        {
            try
            {
                string id = ((AppMessage)MessagesLB.SelectedIndex())?.Id;
                if (!string.IsNullOrEmpty(id))
                {
                    AppMessage message = _messages.GetMessage(id);

                    if (message != null)
                    {
                        MessageListBox.Refresh();
                        SetMessageDetails(message);
                        ToggleButtons(true, message.Show ? HIDE : SHOW);
                    }
                }
            }
            catch (Exception)
            {
                // Something happened
            }
        }
예제 #2
0
 private void MessageListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     UpdateMessageDetails();
     MessageListBox.Refresh();
 }