Пример #1
0
        private void División_Click(object sender, RoutedEventArgs e)
        {
            nextClick = new División();
            División div = (División)nextClick;

            Eject += new Action <object, RoutedEventArgs>(div.a);
        }
Пример #2
0
 public void a(object sender, RoutedEventArgs e)
 {
     if (suma != null)
     {
         Suma i = (Suma)suma;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (resta != null)
     {
         Resta i = (Resta)resta;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (multiplicacion != null)
     {
         Multiplicación i = (Multiplicación)multiplicacion;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (division != null)
     {
         División i = (División)division;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (seno != null)
     {
         Seno i = (Seno)seno;
         paraPrimero     = i.textBlock1.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (coseno != null)
     {
         Coseno i = (Coseno)coseno;
         paraPrimero     = i.textBlock1.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (factorial != null)
     {
         Factorial i = (Factorial)factorial;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (comparadorIgual != null)
     {
         ComparadorIgual i = (ComparadorIgual)comparadorIgual;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (comparadorMeIgual != null)
     {
         ComparadorMenorIgual i = (ComparadorMenorIgual)comparadorMeIgual;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (comprMenor != null)
     {
         ComparadorMenor i = (ComparadorMenor)comprMenor;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (compDist != null)
     {
         ComparadorDistinto i = (ComparadorDistinto )compDist;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (compMayor != null)
     {
         ComparadorMayor i = (ComparadorMayor )compMayor;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (compMayorIguaL != null)
     {
         ComparadorMayorIgual i = (ComparadorMayorIgual)compMayorIguaL;
         paraPrimero     = i.textB.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
     else if (fibo != null)
     {
         Fibonacci i = (Fibonacci)fibo;
         paraPrimero     = i.textBlock1.Text;
         textBlock2.Text = paraPrimero;
         textBox1.Text   = paraPrimero;
     }
 }
Пример #3
0
        private void textBox1_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (MainWindow.inicia != null)
            {
                MainWindow.finaliza = this;

                if (MainWindow.inicia is Suma)
                {
                    suma = (Suma)MainWindow.inicia;
                }
                else if (MainWindow.inicia is Resta)
                {
                    resta = (Resta)MainWindow.inicia;
                }
                else if (MainWindow.inicia is Multiplicación)
                {
                    multiplicacion = (Multiplicación)MainWindow.inicia;
                }
                else if (MainWindow.inicia is División)
                {
                    division = (División)MainWindow.inicia;
                }
                else if (MainWindow.inicia is Factorial)
                {
                    factorial = (Factorial)MainWindow.inicia;
                }
                else if (MainWindow.inicia is Seno)
                {
                    seno = (Seno)MainWindow.inicia;
                }
                else if (MainWindow.inicia is Coseno)
                {
                    coseno = (Coseno)MainWindow.inicia;
                }
                else if (MainWindow.inicia is ComparadorDistinto)
                {
                    compDist = (ComparadorDistinto)MainWindow.inicia;
                }
                else if (MainWindow.inicia is ComparadorIgual)
                {
                    comparadorIgual = (ComparadorIgual)MainWindow.inicia;
                }

                else if (MainWindow.inicia is ComparadorMayor)
                {
                    compMayor = (ComparadorMayor)MainWindow.inicia;
                }
                else if (MainWindow.inicia is ComparadorMayorIgual)
                {
                    compMayorIguaL = (ComparadorMayorIgual)MainWindow.inicia;
                }
                else if (MainWindow.inicia is ComparadorMenor)
                {
                    comprMenor = (ComparadorMenor)MainWindow.inicia;
                }
                else if (MainWindow.inicia is ComparadorMenorIgual)
                {
                    comparadorMeIgual = (ComparadorMenorIgual)MainWindow.inicia;
                }
                else if (MainWindow.inicia is Fibonacci)
                {
                    fibo = (Fibonacci)MainWindow.inicia;
                }
            }
        }
Пример #4
0
        private void Canvas_CLick(object sender, MouseButtonEventArgs mouse)
        {
            ju = mouse;
            if (nextClick is Linea)
            {
                nextClick = null;
            }
            else if (nextClick != null)
            {
                Point posicion = mouse.GetPosition(this);
                if (posicion.Y > 26)
                {
                    Canvas.SetTop(nextClick, posicion.Y);
                    Canvas.SetLeft(nextClick, posicion.X);
                    uf.Children.Add(nextClick);
                    nextClick.ContextMenu = new ContextMenu();
                    MenuItem conectar = new MenuItem();
                    conectar.Header = "_Conectar";
                    nextClick.ContextMenu.Items.Add(conectar);
                    conectar.Click += hacerLinea;
                    MenuItem CancelarConexion = new MenuItem();
                    CancelarConexion.Header = "_Cancelar Conexión";
                    nextClick.ContextMenu.Items.Add(CancelarConexion);
                    CancelarConexion.Click += noHacerLinea;
                    delete        = new MenuItem();
                    delete.Header = "_Borrar";
                    nextClick.ContextMenu.Items.Add(delete);
                    execute        = new MenuItem();
                    execute.Header = "_Ejecutar";
                    nextClick.ContextMenu.Items.Add(execute);

                    if (nextClick is Suma)
                    {
                        Suma res = (Suma)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Resta)
                    {
                        Resta res = (Resta)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Multiplicación)
                    {
                        Multiplicación res = (Multiplicación)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is División)
                    {
                        División res = (División)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Input)
                    {
                        Input res = (Input)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is OutputIntermedio)
                    {
                        OutputIntermedio res = (OutputIntermedio)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is OutputFinal)
                    {
                        OutputFinal res = (OutputFinal)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Factorial)
                    {
                        Factorial res = (Factorial)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Seno)
                    {
                        Seno res = (Seno)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Coseno)
                    {
                        Coseno res = (Coseno)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is ComparadorDistinto)
                    {
                        ComparadorDistinto res = (ComparadorDistinto)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is ComparadorIgual)
                    {
                        ComparadorIgual res = (ComparadorIgual)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }

                    else if (nextClick is ComparadorMayor)
                    {
                        ComparadorMayor res = (ComparadorMayor)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is ComparadorMayorIgual)
                    {
                        ComparadorMayorIgual res = (ComparadorMayorIgual)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is ComparadorMenor)
                    {
                        ComparadorMenor res = (ComparadorMenor)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is ComparadorMenorIgual)
                    {
                        ComparadorMenorIgual res = (ComparadorMenorIgual)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Fibonacci)
                    {
                        Fibonacci res = (Fibonacci)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Separador)
                    {
                        Separador res = (Separador)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                    else if (nextClick is Plotter)
                    {
                        Plotter res = (Plotter)nextClick;
                        res.a(sender, mouse);
                        execute.Click += res.a;
                        delete.Click  += res.b;
                    }
                }
                nextClick = null;
            }
        }