Exemplo n.º 1
0
        public void Finished(EventTokenTriggerToolDragging token)
        {
            if (CurrentParts == null)
            {
                return;
            }

            CurrentParts.DesignState = PartsJitBase.DesignStates.Normal;
            CurrentParts.Location    = GetCoderPos(PaneJitParts, token.Pointer);
            var processID = JacInterpreter.MakeID("Process");

            CurrentParts.ID = processID;

            var jacredo =
                $@"
                TheStage
                    Procs
                        add new Process
                            ID = '{processID}'
                            LocationX = {CurrentParts.Location.X.Cx.m}m
                            LocationY = {CurrentParts.Location.Y.Cy.m}m
                            Width = {CurrentParts.Width.m}m
                            Height = {CurrentParts.Height.m}m
                Gui.ClearAllSelection = true
                Gui.CreateProcess = {processID}
            ";
            var jacundo =
                $@"
                Gui.RemoveProcess = {processID}
                TheStage
                    Procs
                        remove {processID}
            ";

            SetNewAction(token, jacredo, jacundo);

            // remove toolbox parts. (Expecting to be created by REDO processor)
            Parts.Remove(PaneJitParts, CurrentParts, LAYER.JitProcess);
            CurrentParts = null;
        }
Exemplo n.º 2
0
        public void Finished(EventTokenTriggerToolDragging token)
        {
            if (CreatingParts == null)
            {
                return;
            }

            CreatingParts.DesignState = PartsJitBase.DesignStates.Normal;
            CreatingParts.Location    = GetCoderPos(PaneJitParts, token.Pointer);
            var workID = JacInterpreter.MakeID("Work");

            CreatingParts.ID = workID;

            var jacredo =
                $@"
                TheStage
                    Works
                        add datetime('{Now.ToString(TimeUtil.FormatYMDHMSms)}'):new Work
                            ID = '{workID}'
                            LocationX = {CreatingParts.Location.X.Cx.m}m
                            LocationY = {CreatingParts.Location.Y.Cy.m}m
                            Width = {CreatingParts.Width.m}m
                            Height = {CreatingParts.Height.m}m
                Gui.ClearAllSelection = true
                Gui.CreateWork = {workID}
            ";
            var jacundo =
                $@"
                Gui.RemoveWork = {workID}
                TheStage
                    Works
                        remove {workID}
            ";

            SetNewAction(token, jacredo, jacundo);

            // remove toolbox parts. (Expecting to be created by REDO processor)
            Parts.Remove(PaneJitParts, CreatingParts, LAYER.JitWork);
            CreatingParts = null;
        }