コード例 #1
0
        public void PanaikintiEile(int Eile)
        {
            MediaPlayer player = new MediaPlayer();
            string      a      = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
            string      b      = System.IO.Path.Combine(a, "sms-alert-3-daniel_simon.mp3");

            player.Open(new Uri(b));
            player.Play();
            for (int i = 0; i < UzimtiLangeliai.Count; i++)
            {
                if (Convert.ToInt32(UzimtiLangeliai[i].Koord.X) == Eile)
                {
                    NuspalvintLangeli(Convert.ToInt32(UzimtiLangeliai[i].Koord.X), Convert.ToInt32(UzimtiLangeliai[i].Koord.Y), Colors.Black);
                    UzimtiLangeliai.Remove(UzimtiLangeliai[i]);
                    i -= 1;
                }
            }
            UzimtiLangeliai = UzimtiLangeliai.OrderByDescending(p => p.Koord.X).ThenByDescending(p => p.Koord.Y).ToList(); // rikiavimas nuo apacios
            for (int i = 0; i < UzimtiLangeliai.Count; i++)
            {
                Langelis lang = UzimtiLangeliai[i];
                if (lang.Koord.X < Eile)
                {
                    SolidColorBrush brush = lang.myRect.Fill as SolidColorBrush;
                    NuspalvintLangeli(lang, Colors.Black);
                    NuspalvintLangeli(Convert.ToInt32(lang.Koord.X + 1), Convert.ToInt32(lang.Koord.Y), brush.Color);
                    int indeksas = Convert.ToInt32(lang.Koord.X * 10 - 10 + lang.Koord.Y - 1);
                    UzimtiLangeliai[i] = VisiLangeliai[indeksas + 10];
                }
            }
        }
コード例 #2
0
        public void PiestiPagrindineLenta()
        {
            int Eile      = 1;
            int Stulpelis = 1;
            int x         = 0;
            int y         = 0;

            for (int i = 0; i < 200; i++)
            {
                Langelis lang = new Langelis();
                lang.myRect                 = new Rectangle();
                lang.myRect.Stroke          = new SolidColorBrush(Colors.SaddleBrown);
                lang.myRect.StrokeThickness = 1;
                lang.myRect.Width           = 30;
                lang.myRect.Height          = 30;
                lang.myRect.Fill            = new SolidColorBrush(Colors.Black);
                Canvas.SetLeft(lang.myRect, x);
                Canvas.SetTop(lang.myRect, y);
                myCnv.Children.Add(lang.myRect);
                lang.Koord = new Point(Eile, Stulpelis);
                VisiLangeliai.Add(lang);
                x         += 30;
                Stulpelis += 1;
                if (x == 300)
                {
                    Eile     += 1;
                    Stulpelis = 1;
                    y        += 30;
                    x         = 0;
                }
            }
        }
コード例 #3
0
        public void PiestiSalutineLenta()
        {
            int x         = 360;
            int y         = 30;
            int Eile      = 1;
            int Stulpelis = 1;

            for (int i = 0; i < 15; i++) // nubraizom salutinius langelius
            {
                Langelis lang = new Langelis();
                lang.myRect                 = new Rectangle();
                lang.myRect.Stroke          = new SolidColorBrush(Colors.SaddleBrown);
                lang.myRect.StrokeThickness = 1;
                lang.myRect.Width           = 30;
                lang.myRect.Height          = 30;
                lang.myRect.Fill            = new SolidColorBrush(Colors.Gainsboro);
                Canvas.SetLeft(lang.myRect, x);
                Canvas.SetTop(lang.myRect, y);
                myCnv.Children.Add(lang.myRect);
                lang.Koord = new Point(Eile, Stulpelis);
                VisiLangeliai.Add(lang);
                x         += 30;
                Stulpelis += 1;
                if (x == 510)
                {
                    Eile     += 1;
                    Stulpelis = 1;
                    y        += 30;
                    x         = 360;
                }
            }
        }
コード例 #4
0
        public void NuspalvintLangeli(int eile, int stulpelis, Color color)
        {
            int      indeksas = (eile * 10) - (10 - stulpelis) - 1;
            Langelis lang     = VisiLangeliai[indeksas];

            VisiLangeliai[indeksas].myRect.Fill = new SolidColorBrush(color);
            VisiLangeliai[indeksas]             = lang;
        }
コード例 #5
0
 public void Isvalymas()
 {
     for (int i = 0; i < VisiLangeliai.Count; i++)
     {
         Langelis lang = VisiLangeliai[i];
         lang.myRect.Fill   = new SolidColorBrush(Colors.Gainsboro);
         lang.myRect.Stroke = null;
         VisiLangeliai[i]   = lang;
     }
 }
コード例 #6
0
        public void NuspalvintLangeliSmall(int eile, int stulpelis, Color color)
        {
            int      indeksas = (eile * 5) - (5 - stulpelis) + 2;
            Langelis lang     = VisiLangeliai[indeksas];

            lang.myRect.Stroke                  = new SolidColorBrush(Colors.SaddleBrown);
            lang.myRect.StrokeThickness         = 1;
            VisiLangeliai[indeksas].myRect.Fill = new SolidColorBrush(color);
            VisiLangeliai[indeksas]             = lang;
        }
コード例 #7
0
 public void NuspalvintLangeli(Langelis lang, Color color)
 {
     lang.myRect.Fill = new SolidColorBrush(color);
 }