Пример #1
0
        /// <summary>
        /// Draws "ghost" gate for the supplied shape and sets the hoverGate (does nothing if shape is not
        /// a gate)
        /// </summary>
        /// <param name="gate"></param>
        /// <param name="pos"></param>
        public void DrawFeedback(Sketch.Shape shape, bool isHoverGate = false, bool drawingOneGate = true)
        {
            if (!Domain.LogicDomain.IsGate(shape.Type) || ShapeToGate.ContainsKey(shape))
            {
                return;
            }

            KeyValuePair <List <string>, List <string> > shapeIO;

            ShapeToIO.TryGetValue(shape, out shapeIO);
            GhostGate ghostGate = new GhostGate(shape, ref sketchPanel, ref gateDrawer, gateRotated, shapeIO);

            ShapeToGate[shape] = ghostGate;

            ghostGate.SubscribeEvents();

            currGhosts.Add(ghostGate);

            if (isHoverGate)
            {
                hoverGate = ghostGate;

                //if (shape.UserLabeled)
                //  hoverGate.ShowDrawingAdvice();
            }

            if (shape.UserLabeled)
            {
                ghostGate.ShowDrawingAdvice();
            }
        }
        /// <summary>
        /// Draws "ghost" gate for the supplied shape
        /// </summary>
        /// <param name="gate"></param>
        /// <param name="pos"></param>
        public void DrawFeedback(Sketch.Shape shape, bool isHoverGate = false)
        {
            if (!Domain.LogicDomain.IsGate(shape.Type))
            {
                return;
            }

            GhostGate ghostGate = new GhostGate(shape, ref sketchPanel, ref gateDrawer);

            ghostGate.SubscribeEvents();
            currGhosts.Add(ghostGate);

            if (isHoverGate)
            {
                hoverGate = ghostGate;
            }

            if (shape.UserLabeled)
            {
                ghostGate.ShowDrawingAdvice();
            }
        }