Beispiel #1
0
        public void DropShapeFromTool(ITool <Gdk.Event, Cairo.Context, Model> tool, Rectangle dropTo, Shape currentInfoObject = null)
        {
            //TODO: May we simulate drag&drop mechanism to send data?

            IServiceContainer plugins  = solidIDE.GetServiceContainer();
            IDesigner         designer = plugins.GetService <IDesigner>();

            if (designer != null && designer.CurrentSheet != null)
            {
                if (tool != null)
                {
                    ShapeFromTool(tool, dropTo, currentInfoObject);
                    tool.Command().Do();
                }
                else if (currentInfoObject != null)
                {
                    designer.AddShapes(currentInfoObject.DeepCopy());
                }
            }
        }
Beispiel #2
0
 public virtual void Do()
 {
     designer.AddShapes(NewShape.DeepCopy());
 }