private void btnPreview_Click(object sender, EventArgs e) { frmTemplatePreview frmPreview = null; try { frmPreview = new frmTemplatePreview(m_Template); DialogResult result = frmPreview.ShowDialog(); } catch (Exception ex) { // --- Log exception ExceptionManager.Publish(ex); // --- Display Exception ErrorHandler.DisplayError("Nem várt hiba történt a sablon megjelenítése során.", ex); } finally { if (frmPreview != null) frmPreview.Dispose(); } }
/// <summary> /// Shows the preview form. /// </summary> private void PreviewItem() { DBGuid ID = DBGuid.Null; ID.Value = dtgMain.GetSelectedRowCell("ID"); frmTemplatePreview frmPreview = null; try { ITemplateService srv = ServiceFactory.GetTemplateService(); Template template = srv.TemplateSelect(ID); frmPreview = new frmTemplatePreview(template); DialogResult result = frmPreview.ShowDialog(); } catch (Exception ex) { // --- Log exception ExceptionManager.Publish(ex); // --- Display Exception ErrorHandler.DisplayError("Hiba történt a sablon megtekintése során.", ex); } finally { if (frmPreview != null) frmPreview.Dispose(); } }