public void AppendTemplate(Template template) { if (template == null || template.Pages.Count == 0) return; this.Pages.AddRange(template.Pages); }
public void Open() { bool opened = false; if (this.OpenTemplate == null) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Template Files|*.fxt"; if (ofd.ShowDialog() == DialogResult.OK) { this.fileName = ofd.FileName; this.template = Template.Open(this.fileName); opened = true; } } else { KeyValuePair<string, byte[]> file = this.OpenTemplate(); if (!String.IsNullOrEmpty(file.Key) && file.Value != null && file.Value.Length > 0) { this.fileName = file.Key; this.template = Template.Open(file.Value); opened = true; } } if (opened) ShowTemplate(); }
public void PrependTemplate(Template template) { if (template == null || template.Pages.Count == 0) return; List<Page> pages = this.Pages; this.Pages = new List<Page>(); this.Pages.AddRange(template.Pages); this.Pages.AddRange(pages); }