예제 #1
0
        private void ContexMenuAddClicked(object sender, RoutedEventArgs e)
        {
            Dialogs.AddRemoveIntervalMessageDialog arimd = new Dialogs.AddRemoveIntervalMessageDialog();
            var result = arimd.ShowDialog();

            if (result != null && result == true)
            {
                IntervalMessages.Messages.Add(arimd.ReturnedIntervalMessage);
                ListView_IntervalMessages.Items.Refresh();
            }
        }
예제 #2
0
        private void ContexMenuEditClicked(object sender, RoutedEventArgs e)
        {
            if (ListView_IntervalMessages.SelectedItem != null)
            {
                var id = ListView_IntervalMessages.SelectedIndex;

                var msg = (SuiBot_Core.Storage.IntervalMessage)ListView_IntervalMessages.Items[id];

                Dialogs.AddRemoveIntervalMessageDialog arimd = new Dialogs.AddRemoveIntervalMessageDialog(msg);
                var result = arimd.ShowDialog();
                if (result != null && result == true)
                {
                    IntervalMessages.Messages[id] = arimd.ReturnedIntervalMessage;
                    ListView_IntervalMessages.Items.Refresh();
                }
            }
        }