private void butDeleteTemplate_Click(object sender, EventArgs e)
        {
            var delete = MessageBox.Show(Translation.LanguageStrings.MsgAskDeleteTemplate, "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (delete == DialogResult.Yes)
            {
                var templateProcessor = new TemplateProcessor(Directories.AppRootPath);
                if (Directories.AllowSaveTemplatesToFiles)
                {
                    var deleted = templateProcessor.DeleteTemplateFile(this.selectedGroupTemplate);
                    if (deleted == true)
                    {
                        GroupTemplateDeletedInGroupTemplateEditor?.Invoke(this.selectedGroupTemplate);
                        ucTemplateSelector1.RemoveSelectedTemplate();
                    }
                }
                else
                {
                    GroupTemplateDeletedInGroupTemplateEditor?.Invoke(this.selectedGroupTemplate);
                    ucTemplateSelector1.RemoveSelectedTemplate();
                }
            }
        }
Beispiel #2
0
 private void UcGroupTemplateEditor1_GroupTemplateDeletedInGroupTemplateEditor(DocumentGroupTemplate deletedGroupTemplate)
 {
     GroupTemplateDeletedInGroupTemplateEditor?.Invoke(deletedGroupTemplate);
 }