public void OpenModel() { if (string.IsNullOrWhiteSpace(Model)) { MessageBox.Show("Selectionner template!"); return; } ovExport = new OvPdfModelExport(type, Model, Item); ovExport.EditTemplate(); }
public void CreateModel() { if (string.IsNullOrWhiteSpace(CurrentText)) { MessageBox.Show("Saisir nom template"); return; } ovExport = new OvPdfModelExport(type, CurrentText, Item); ovExport.EditTemplate(); }
private void GetModels() { var temp = (Item as ExtendedDocument).DefaultTemplate; var ModelName = type.Name; if (DefaultTemplate) { // use default Model = ModelName; Create(); } if (string.IsNullOrWhiteSpace(ModelName)) { return; } var folder = $"templates/{ModelName }"; if (!Directory.Exists(folder)) { MessageBox.Show("Modéle introuvable!, Créer nouveau"); OvPdfModelExport ov = new OvPdfModelExport(type); ov.EditTemplate(ModelName); return; } var models = Directory.EnumerateFiles(folder); foreach (var item in models) { var file = Path.GetFileNameWithoutExtension(item); Models.Add(file); } // Models = new HashSet<string>(models.Select(); NotifyOfPropertyChange("Models"); }