예제 #1
0
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new EditAlarmDlg(-1)
            {
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                Owner = this,
            };

            if ((bool)dlg.ShowDialog())
            {
                AddAudibleAlarmItems();
                AlarmManager.LoadAlarms();
            }
        }
예제 #2
0
        private void EditButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedItem = ((VMSListBoxItem)AlarmsList.SelectedItem);

            if (selectedItem != null)
            {
                var itemId = selectedItem.ID;
                var dlg    = new EditAlarmDlg(itemId)
                {
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                    Owner = this,
                };
                if ((bool)dlg.ShowDialog())
                {
                    AddAudibleAlarmItems();
                    AlarmManager.LoadAlarms();
                }
            }
        }