Ejemplo n.º 1
0
        public void GestureComplete(IPointerEvent evnt)
        {
            Location cur = current;

            if (currentValid)
            {
                // Console.WriteLine("**** Adding {0} ****", master.GetType().Name);
                layoutModel.Execute((ILayoutAccess lo) => {
                    if (master is ModuleComponent)
                    {
                        ProjectModule sub = ((ModuleComponent)master).Module;
                        if (sub.HasDescendent(lo.Layout))
                        {
                            return;
                        }
                    }
                    Component clone = lo.AddComponent(master, cur.X, cur.Y);
                    WireTools.CheckForSplits(lo, layoutModel.WiringPoints, new Component[] { clone });
                });
            }
            this.current      = new Location(0, 0);
            this.currentValid = false;
            OnGestureCompleteEvent(true);
            layoutModel.Gesture = null;
            evnt.RepaintCanvas();
        }