Пример #1
0
        public void Delete(Template template)
        {
            var result = _dialogCreator.MessageBoxYesNo(PKSimConstants.UI.ReallyDeleteTemplate(template.Name));

            if (result == ViewResult.No)
            {
                return;
            }
            _templateTaskQuery.DeleteTemplate(template);
            _view.DestroyNode(template.Id);
        }
        public void Delete(IReadOnlyList <TemplateDTO> templateDTOs)
        {
            var result = _dialogCreator.MessageBoxYesNo(PKSimConstants.UI.ReallyDeleteTemplate(templateDTOs.AllNames()));

            if (result == ViewResult.No)
            {
                return;
            }

            templateDTOs.Each(x =>
            {
                var template = x.Template;
                _templateTaskQuery.DeleteTemplate(template);
                _availableTemplates.Remove(template);
                _selectedTemplates.Remove(template);
            });

            updateView();
        }
Пример #3
0
        public void Delete(Template template)
        {
            var result = _dialogCreator.MessageBoxYesNo(PKSimConstants.UI.ReallyDeleteTemplate(template.Name));

            if (result == ViewResult.No)
            {
                return;
            }

            _templateTaskQuery.DeleteTemplate(template);
            _view.DestroyNode(template.Id);
            _selectedTemplates.Remove(template);

            var nextSelectedTemplate = _selectedTemplates.FirstOrDefault();

            if (nextSelectedTemplate != null)
            {
                _view.SelectTemplate(nextSelectedTemplate);
            }

            updateView();
        }