static void OnBulkConvertClick(object sender, EventArgs e) { try { PDNBulkUpdater.BulkUpdateWindow window = new PDNBulkUpdater.BulkUpdateWindow(); System.Windows.Interop.WindowInteropHelper hlpr = new System.Windows.Interop.WindowInteropHelper(window); hlpr.Owner = m_mainWindow == null ? IntPtr.Zero : m_mainWindow.Handle; try { window.ShowDialog(); } catch (Exception ex) { PDNUtilities.ErrorBox(m_mainWindow, ex.ToString()); if (window.IsVisible) { window.Close(); } } } catch (Exception ex) { PDNUtilities.ErrorBox(m_mainWindow, ex.ToString()); } }
public static PaintDotNet.Document CanvasResize(PaintDotNet.Document doc, System.Drawing.Size newSize, PDNAnchorEdge anchor, PaintDotNet.ColorBgra background) { Type canvasSizeActionType = GetAssemblyPaintDotNet().GetType("PaintDotNet.Actions.CanvasSizeAction"); object anchorEdge = PDNUtilities.PDNAnchorEdgeToAnchorEdge(anchor); PaintDotNet.Document newDoc = (PaintDotNet.Document)canvasSizeActionType.GetMethod("ResizeDocument").Invoke(null, new object[] { doc, newSize, anchorEdge, background }); return(newDoc); }