Beispiel #1
0
        private void pokaziDemo()
        {
            while (true)
            {
                Thread.Sleep(2000);
                LinearGradientBrush old = new LinearGradientBrush();

                IzborViseSoftvera izbor = null;
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    old = (LinearGradientBrush)DodajButton.Background;
                    DodajButton.Background = Brushes.Red;
                });
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    DodajButton.Background = old;
                });

                Thread.Sleep(200);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    gridUcionice.IsEnabled     = true;
                    DodajButton.IsEnabled      = false;
                    Odustani.Visibility        = Visibility.Visible;
                    SacuvajUcionicu.Visibility = Visibility.Visible;
                    SelectedUcionica           = new Ucionica();
                });
                EnableIzmijeni = false;
                EnableIzbrisi  = false;
                RezimPregled   = false;


                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    idBox.Background = Brushes.Red;
                });
                SelectedUcionica.Id = "U";
                Thread.Sleep(300);
                SelectedUcionica.Id = "U1";
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    idBox.Background = Brushes.White;
                });
                Thread.Sleep(200);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    opisBox.Background = Brushes.Red;
                });
                SelectedUcionica.Opis = "o";
                Thread.Sleep(300);
                SelectedUcionica.Opis = "op";
                Thread.Sleep(300);
                SelectedUcionica.Opis = "opi";
                Thread.Sleep(300);
                SelectedUcionica.Opis = "opis";
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    opisBox.Background = Brushes.White;
                });
                Thread.Sleep(200);
                App.Current.Dispatcher.Invoke((Action) delegate // <--- HERE
                {
                    brojMjestaBox.Background = Brushes.Red;
                });
                Thread.Sleep(300);
                SelectedUcionica.BrojMjesta = 1;
                Thread.Sleep(300);
                SelectedUcionica.BrojMjesta = 18;
                Thread.Sleep(300);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    brojMjestaBox.Background = Brushes.White;
                });
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    projektorBox.Background = Brushes.Red;
                });

                Thread.Sleep(500);
                SelectedUcionica.Projektor = true;
                App.Current.Dispatcher.Invoke((Action) delegate {
                    projektorBox.Background = Brushes.White;
                });
                Thread.Sleep(1000);

                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    osCombo.IsDropDownOpen = true;
                });


                Thread.Sleep(1000);
                selectedUcionica.InstaliranOS = OS.linux;
                Thread.Sleep(500);

                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    osCombo.IsDropDownOpen = false;
                });

                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    Izaberi.Background = Brushes.Red;
                });


                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    izbor = new IzborViseSoftvera("demo");
                    izbor.Show();
                });
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    izbor.Softveri[0].Odabran = true;
                });

                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    izbor.Potvrdi.Background = Brushes.Red;
                });

                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    izbor.Close();

                    Izaberi.Background = Brushes.Gray;
                });


                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    SacuvajUcionicu.Background = Brushes.Red;
                });
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    SacuvajUcionicu.Background = old;
                });
                Thread.Sleep(500);

                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    Ucionice.Add(SelectedUcionica);
                    Izaberi.Background = Brushes.Gray;
                    RezimPregled       = true;
                });
                RezimPregled   = true;
                EnableIzbrisi  = true;
                EnableIzmijeni = true;
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    SacuvajUcionicu.Visibility = Visibility.Hidden;
                    Odustani.Visibility        = Visibility.Hidden;
                    SacuvajIzmjenu.Visibility  = Visibility.Hidden;
                    IzmjenaOdustani.Visibility = Visibility.Hidden;
                    DodajButton.IsEnabled      = true;
                });
                Thread.Sleep(2000);

                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    IzmijeniButton.Background = Brushes.Red;
                });
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    IzmijeniButton.Background = old;
                });

                Thread.Sleep(200);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    gridUcionice.IsEnabled     = true;
                    DodajButton.IsEnabled      = false;
                    IzmjenaOdustani.Visibility = Visibility.Visible;
                    SacuvajIzmjenu.Visibility  = Visibility.Visible;
                });
                EnableIzmijeni = false;
                EnableIzbrisi  = false;
                RezimPregled   = false;


                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    opisBox.Background = Brushes.Red;
                });
                SelectedUcionica.Opis = "d";
                Thread.Sleep(300);
                SelectedUcionica.Opis = "dr";
                Thread.Sleep(300);
                SelectedUcionica.Opis = "dru";
                Thread.Sleep(300);
                SelectedUcionica.Opis = "drug";
                Thread.Sleep(300);
                SelectedUcionica.Opis = "drugi";
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    opisBox.Background = Brushes.White;
                });
                Thread.Sleep(1000);

                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    SacuvajIzmjenu.Background = Brushes.Red;
                });
                Thread.Sleep(600);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    SacuvajIzmjenu.Background = old;
                });
                Thread.Sleep(500);


                RezimPregled   = true;
                EnableIzbrisi  = true;
                EnableIzmijeni = true;
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    SacuvajUcionicu.Visibility = Visibility.Hidden;
                    Odustani.Visibility        = Visibility.Hidden;
                    SacuvajIzmjenu.Visibility  = Visibility.Hidden;
                    IzmjenaOdustani.Visibility = Visibility.Hidden;
                    DodajButton.IsEnabled      = true;
                });
                Thread.Sleep(2000);

                //obrisi
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    ObrisiButton.Background = Brushes.Red;
                });
                Thread.Sleep(1000);
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    ObrisiButton.Background = old;
                });


                Thread.Sleep(1000);

                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    Ucionice.Remove(SelectedUcionica);
                    if (Ucionice.Count > 0)
                    {
                        SelectedUcionica         = Ucionice[0];
                        var item                 = dgrUcionice.Items[0];
                        dgrUcionice.SelectedItem = item;
                        EnableIzmijeni           = true;
                        EnableIzbrisi            = true;
                    }
                    else
                    {
                        SelectedUcionica = null;
                        EnableIzmijeni   = false;
                        EnableIzbrisi    = false;
                    }
                    RezimPregled = true;
                });

                Thread.Sleep(2000);
            }
        }
Beispiel #2
0
        private void Izaberi_Click(object sender, RoutedEventArgs e)
        {
            IzborViseSoftvera izbor = new IzborViseSoftvera(SelectedUcionica.InstaliraniSoftver);

            izbor.Show();
        }