Esempio n. 1
0
        private void UpdateUserAction(object sender, RoutedEventArgs e)
        {
            if (fieldResults.SelectedIndex != -1)
            {
                Dialoge w = new Dialoge(Program.FindADUser(fieldResults.SelectedValue.ToString()));
                w.ShowDialog();

                if (w.DialogResult == true)
                {
                    Debug.WriteLine(fieldResults.SelectedValue.ToString().Substring(9));
                    //try
                    //{
                    if (Program.UpdateUser(fieldResults.SelectedValue.ToString(), w.Answer))
                    {
                        MessageBox.Show("User succesfully updated!");
                        btnCreateUser.IsEnabled = btnDeleteUser.IsEnabled = btnUpdateUser.IsEnabled = false;
                    }
                    //}
                    //catch (Exception ex)
                    //{
                    //    MessageBox.Show(ex.Message);
                    //}
                }
            }
            else
            {
                MessageBox.Show("Select a user first!");
            }
        }
Esempio n. 2
0
        private void MakeRoad()
        {
            var data = new RoadDialogeViewModel();
            var view = new RoadDialogeView
            {
                DataContext = data,
                ViewModel   = data
            };

            Mouse.OverrideCursor = Cursors.Arrow;
            Dialoge.ShowDialog(view, "Road builder");
            Mouse.OverrideCursor = Cursors.Pen;

            if (data.Length == 0)
            {
                return;
            }

            var road = new RoadCore(core.Canvas, first, second, simulationService, data.Length);

            try
            {
                (core as StationCore).AddRoadToEach(road);
                (core.SimulationModel as Station).AttachRoad(road.SimulationModel as Road);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Esempio n. 3
0
 public void StartDialoge(Dialoge dialoge)
 {
     sentences.Clear();
     foreach (string sentence in dialoge.sentences)
     {
         sentences.Enqueue(sentence);
     }
     DisplayNextSentence();
 }
Esempio n. 4
0
 public void StartDialoge(Dialoge dialoge)
 {
     animator.SetBool("IsOpen", true);
     nameText.text = dialoge.name;
     sentences.Clear();
     foreach (string sentence in dialoge.sentence)
     {
         sentences.Enqueue(sentence);
     }
     DisplayNextSentence();
 }
Esempio n. 5
0
 /*
  * This method sets up the dialogue box.
  */
 public void StartDialoge(Dialoge d)
 {
     pr.isMouseInUse = true;
     ss.Clear();         // Clear queue of strings.
     dialogeUI.SetActive(true);
     // Grabs an array of sentences and puts it in a queue.
     foreach (string sentence in d.sentences)
     {
         ss.Enqueue(sentence);
     }
     button.interactable = true;         // Make button interactive.
     DisplayNext();
 }
Esempio n. 6
0
    public void startDialoge(Dialoge dialoge)
    {
        boxAnim.SetBool("boxOpen", true);
        startAnim.SetBool("startOpen", false);
        nameText.text = dialoge.name;
        sentences.Clear();


        foreach (string sentence in dialoge.sentences)
        {
            sentences.Enqueue(sentence);
        }
        DisplayNextSentence();
    }
    public void StartDialoge(Dialoge IncomingDialoge)
    {
        DialogObject.SetBool("DialogActive", true);  // Activo  el panel de Dialogo!
        Playerbrain.IcanMove = false;                //Le digo al PJ que no se mueva mientas inicia un dialogo.
        NameText.text        = IncomingDialoge.Name; // Le pasa el nombre del NPC al texto que contiene el "Nombre de NPC"

        sentences.Clear();                           // Limpio el contenido de la queue antes de "reasignar" los nuevos valores.

        foreach (string sentece in IncomingDialoge.sentences)
        {
            sentences.Enqueue(sentece); // Recorro "IncomingDialoge" y añado cada párrafo a al queue.
        }
        DisplayNextSentece();           //
    }
Esempio n. 8
0
        private void CreateUserAction(object sender, RoutedEventArgs e)
        {
            Dialoge w = new Dialoge();

            w.ShowDialog();
            if (w.DialogResult == true)
            {
                //try
                //{
                if (Program.CreateUser(w.Answer))
                {
                    MessageBox.Show("User succesfully created!");
                    btnCreateUser.IsEnabled = btnDeleteUser.IsEnabled = btnUpdateUser.IsEnabled = false;
                }
                //}
                //catch (Exception ex)
                //{
                //    MessageBox.Show(ex.Message);
                //}
            }
        }
Esempio n. 9
0
        private static void Click(object sender, RoutedEventArgs e)
        {
            var dataContext = sender as FrameworkElement;

            Mouse.OverrideCursor = Cursors.Arrow;

            if (!(dataContext.DataContext is ISimulationService simulationService))
            {
                throw new Exception($"Element {dataContext} not implement {typeof(ISimulationService)}");
            }
            var vm      = new RouteDialogeViewModel();
            var content = new RouteDialogeView
            {
                DataContext = vm,
            };

            Dialoge.ShowDialog(content, "Route builder");

            simulationService.SetDragService(new CursorAnimation());
            StationCore.SetStationPickService(new DefaultPickService(simulationService));
            StationCore.UnlockAll();
        }
Esempio n. 10
0
 private void Close_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     (DataContext as RoadDialogeViewModel).Length = 0;
     Dialoge.CloseDialog();
 }
Esempio n. 11
0
 private void Create_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     Dialoge.CloseDialog();
 }