コード例 #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());
                }
            }
        }
コード例 #2
0
 public virtual void Do()
 {
     designer.AddShapes(NewShape.DeepCopy());
 }