Hi Support!
I would like to enable Copy/Paste in my application.
I copied MinimalApp form to my project and call it. Everything is ok with paste…
public class MinimalApp : Form
{
public MinimalApp()
{
this.Text = “Minimal GoDiagram App”;
// create a Go view (a Control) and add to the form
GoView myView = new GoView();
myView.Dock = DockStyle.Fill;
this.Controls.Add(myView);
// create two nodes for fun...
GoBasicNode node1 = new GoBasicNode();
// specify position, label and color
node1.Location = new PointF(100, 100);
node1.Text = "first";
node1.Editable = true; // first node is editable with F2 only
node1.Shape.BrushColor = Color.Blue;
// add to the document, not to the view
myView.Document.Add(node1);
GoBasicNode node2 = new GoBasicNode();
node2.Location = new PointF(200, 100);
node2.Text = "second";
node2.Label.Editable = true; // second node is editable by clicking only
node2.Shape.BrushColor = Color.Magenta;
myView.Document.Add(node2);
}
}
But after, I inserted a class, and create a MyDisplay99 object… and paste stopped!! Why?? This is a simple example with this class MyDisplay99 .
See my code:
using System;
using System.Drawing;
using System.Windows.Forms;
using Northwoods.Go;
public class MinimalApp : Form
{
public MinimalApp()
{
this.Text = “Minimal GoDiagram App”;
// create a Go view (a Control) and add to the form
GoView myView = new GoView();
myView.Dock = DockStyle.Fill;
this.Controls.Add(myView);
// create two nodes for fun...
GoBasicNode node1 = new GoBasicNode();
// specify position, label and color
node1.Location = new PointF(100, 100);
node1.Text = "first";
node1.Editable = true; // first node is editable with F2 only
node1.Shape.BrushColor = Color.Blue;
// add to the document, not to the view
myView.Document.Add(node1);
GoBasicNode node2 = new GoBasicNode();
node2.Location = new PointF(200, 100);
node2.Text = "second";
node2.Label.Editable = true; // second node is editable by clicking only
node2.Shape.BrushColor = Color.Magenta;
myView.Document.Add(node2);
//NEW CODE!!
MyDisplay99 mytest = new MyDisplay99();
myView.Document.Add(mytest);
}
}
[Serializable]
public class MyDisplay99 : GoBasicNode
{
public MyDisplay99()
{
this.Text = “first”;
this.Shape.BrushColor = Color.Red;
}
}