Ejemplo n.º 1
0
        //przekazywanie wiadomości
        void WyswietlKomunikat(string komunikat)
        {
            MessageViewer.Content += komunikat + "\n";
            MessageViewer.ScrollToEnd();

            //ImageBulb.Opacity = 0;
            //ImageBulbBlack.Opacity = 1;
            //DoubleAnimation FadeIn = new DoubleAnimation();
            //FadeIn.From = 0;
            //FadeIn.To = 1;
            //FadeIn.Duration = TimeSpan.FromSeconds(3);

            DoubleAnimation FadeOut = new DoubleAnimation();

            FadeOut.From     = 1;
            FadeOut.To       = 0;
            FadeOut.Duration = TimeSpan.FromSeconds(0.2);

            //ImageBulb.BeginAnimation(OpacityProperty, FadeOut);
            //ImageBulbBlack.BeginAnimation(OpacityProperty, FadeIn);

            RepeatBehavior Repeat = new RepeatBehavior(8.0);

            FadeOut.RepeatBehavior = Repeat;
            ImageBulbBlack.BeginAnimation(OpacityProperty, FadeOut);
            System.Media.SystemSounds.Beep.Play();
        }
Ejemplo n.º 2
0
        void WyswietlKomunikat(string komunikat)
        {
            MessageViewer.Content += komunikat + "\n";
            MessageViewer.ScrollToEnd();

            //Odświeżenie wyświetlanej tabeli

            if (komunikat.Contains("Dodano rekord") || komunikat.Contains("Usunięto rekord") || komunikat.Contains("Zaktualizowano rekord"))
            {
                if (komunikat.Contains("Dziennikarze") && currentTable == "Dziennikarze")
                {
                    btnWyswietl1_Click(this, new RoutedEventArgs());
                }
                else if (komunikat.Contains("Redakcje") && currentTable == "Redakcje")
                {
                    btnWyswietl2_Click(this, new RoutedEventArgs());
                }
                else if (komunikat.Contains("Wolontariusze") && currentTable == "Wolontariusze")
                {
                    btnWyswietl3_Click(this, new RoutedEventArgs());
                }
                else if (komunikat.Contains("Pracownicy") && currentTable == "Pracownicy")
                {
                    btnWyswietl4_Click(this, new RoutedEventArgs());
                }
                else if (komunikat.Contains("Działy") && currentTable == "Działy")
                {
                    btnWyswietl5_Click(this, new RoutedEventArgs());
                }
            }

            //animacja żarówki
            DoubleAnimation FadeOut = new DoubleAnimation();

            FadeOut.From     = 1;
            FadeOut.To       = 0;
            FadeOut.Duration = TimeSpan.FromSeconds(0.2);

            RepeatBehavior Repeat = new RepeatBehavior(8.0);

            FadeOut.RepeatBehavior = Repeat;
            ImageBulbBlack.BeginAnimation(OpacityProperty, FadeOut);
            System.Media.SystemSounds.Beep.Play();
        }