예제 #1
0
        private void Polyline_mouseEnter(object sender, MouseEventArgs e)
        {
            sgc.UpdateText("OnControl");
            Polyline        pl = sender as Polyline;
            SolidColorBrush bc = new SolidColorBrush();

            if (!turn)
            {
                if (Keyboard.IsKeyDown(Key.X) || modeTool == "delete")
                {
                    bc.Color = Colors.Red;
                }
                else
                {
                    bc.Color = Colors.Green;
                }

                ChangeLineStyle(pl, bc, 4);
            }
            else if (pl != previousLine)
            {
                bc.Color = Colors.Gold;
                ChangeLineStyle(pl, bc, 4);

                /*el = new Ellipse();
                 * el.Stroke = Brushes.Black;
                 * el.Fill = Brushes.AliceBlue;
                 * el.Width = 50;
                 * el.Height = 50;
                 * canvas.Children.Add(el);
                 */
            }
        }
        private void Image_MouseEnter(object sender, MouseEventArgs e)
        {
            //isOnImage = true;
            sgc.UpdateText("OnControl");
            Image draggableControl = sender as Image;

            hgc.Highlight_cell(draggableControl);

            SpecificElement se = null;

            foreach (SpecificElement se2 in lc.ec.GetAllElements())
            {
                if (se2.GetName() == draggableControl.Tag.ToString())
                {
                    se = se2;
                    break;
                }
            }

            if (!wgc.turn && se != null)
            {
                mgc.ShowStatusBox(draggableControl, se.voltage);
            }
            hgc.RemoveCheckCircuitBox();
        }
 private void canvas_MouseLeave(object sender, MouseEventArgs e)
 {
     sgc.UpdateText("");
     indicator.Visibility = Visibility.Hidden;
 }