private void cmmiCopyToClipboardWholeGraph_Click(object sender, System.EventArgs e) { #if !DEMO DialogResult dr = MessageBox.Show("Would you like to include selection lines and hatched surface in created metafile?", "Petri .NET Simulator 1.0 - Question", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dr != DialogResult.Cancel) { MemoryStream ms = new MemoryStream(); Graphics g = this.CreateGraphics(); IntPtr ip = g.GetHdc(); Metafile mf = new Metafile(ms, ip); g.ReleaseHdc(ip); g.Dispose(); Graphics gg = Graphics.FromImage(mf); if (dr == DialogResult.Yes) { DrawGraph(gg, this.szRange, true); } else { DrawGraph(gg, this.szRange, false); } gg.Dispose(); // Copy to clipboard ClipboardMetafileHelper.PutEnhMetafileOnClipboard(this.Handle, mf); } #else MessageBox.Show("DEMO version doesn't have implemented Copy to Clipboard function!\nBuy a full version which is capable of Copying to Clipboard.", "Petri .NET Simulator 2.0 - Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); #endif }
private void mcEditCopyModel_Click(object sender, System.EventArgs e) { #if !DEMO MemoryStream ms = new MemoryStream(); Metafile mf = MetafileExporter.SaveMetafile(ms, this.pneEditor); // Copy to clipboard ClipboardMetafileHelper.PutEnhMetafileOnClipboard(this.Handle, mf); #else MessageBox.Show("DEMO version doesn't have implemented Copy to Clipboard function!\nBuy a full version which is capable of Copying to Clipboard.", "Petri .NET Simulator 2.0 - Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); #endif }
private void cmmiCopyToClipboardOnlySelection_Click(object sender, System.EventArgs e) { #if !DEMO MemoryStream ms = new MemoryStream(); Graphics g = this.CreateGraphics(); IntPtr ip = g.GetHdc(); Metafile mf = new Metafile(ms, ip); g.ReleaseHdc(ip); g.Dispose(); Graphics gg = Graphics.FromImage(mf); DrawGraph(gg, this.pnd.ResponseOptions.Selection, false); gg.Dispose(); // Copy to clipboard ClipboardMetafileHelper.PutEnhMetafileOnClipboard(this.Handle, mf); #else MessageBox.Show("DEMO version doesn't have implemented Copy to Clipboard function!\nBuy a full version which is capable of Copying to Clipboard.", "Petri .NET Simulator 2.0 - Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); #endif }