Exemple #1
0
        void AllLoad(string name, int h, int m, int low, int hours, int minutes)
        {
            namef       = name;
            priceHight  = h;
            priceMiddle = m;
            priceLow    = low;
            HOUR        = hours;
            MIN         = minutes;
            sizeroom    = 10;
            sizerow     = 7;

            room           = new Sofa[sizerow][];
            label1.Content = priceLow + " грн";
            label2.Content = priceMiddle + " грн";
            label3.Content = priceHight + " грн";

            mytimer.Tick    += new EventHandler(mytimer_Tick);
            mytimer.Interval = new TimeSpan(0, 0, 1);
            mytimer.Start();



            for (int i = 0; i < sizerow; i++)
            {
                room[i] = new Sofa[sizeroom];

                for (int j = 0; j < sizeroom; j++)
                {
                    if (j == 0)
                    {
                        Label l = new Label();
                        l.Width           = 20;
                        l.Height          = 25;
                        l.BorderThickness = new Thickness(1);
                        l.Content         = sizerow - i;
                        kino.Children.Add(l);
                        continue;
                    }

                    room[i][j] = new Sofa();
                    GetStyle(i, j);

                    room[i][j].butt.Click += new RoutedEventHandler(butt_Click);
                    ToolTip tt = new System.Windows.Controls.ToolTip();
                    tt.Content = (sizerow - i) + " ряд  " + (j) + " место  " + " цена " + room[i][j].Cost + " грн";
                    room[i][j].butt.ToolTip = tt;
                    kino.Children.Add(room[i][j].butt);
                }
            }

            string tmp = "";

            using (StreamReader file = File.OpenText(@"../films/" + namef + ".txt"))
            {
                while (file.Peek() >= 0)
                {
                    tmp += file.ReadLine();
                }
            }
            Info.Text = tmp;



            ImageSourceConverter imgs = new ImageSourceConverter();

            FAce.SetValue(Image.SourceProperty, imgs.ConvertFromString(@"../films/" + namef + ".jpg"));
            screen.SetValue(Image.SourceProperty, imgs.ConvertFromString(@"../timer/im.png"));
        }
        void AllLoad(string name, int h, int m, int low, int hours, int minutes)
        {
            namef = name;
            priceHight = h;
            priceMiddle = m;
            priceLow = low;
            HOUR = hours;
            MIN = minutes;
            sizeroom = 10;
            sizerow = 7;

            room = new Sofa[sizerow][];
            label1.Content = priceLow + " грн";
            label2.Content = priceMiddle + " грн";
            label3.Content = priceHight + " грн";

            mytimer.Tick += new EventHandler(mytimer_Tick);
            mytimer.Interval = new TimeSpan(0, 0,1);
            mytimer.Start();

            for (int i = 0; i < sizerow; i++)
            {
                room[i] = new Sofa[sizeroom];

                for (int j = 0; j < sizeroom; j++)
                {

                    if (j == 0)
                    {
                        Label l = new Label();
                        l.Width = 20;
                        l.Height = 25;
                        l.BorderThickness = new Thickness(1);
                        l.Content = sizerow - i;
                        kino.Children.Add(l);
                        continue;
                    }

                    room[i][j] = new Sofa();
                    GetStyle(i, j);

                    room[i][j].butt.Click += new RoutedEventHandler(butt_Click);
                    ToolTip tt = new System.Windows.Controls.ToolTip();
                    tt.Content = (sizerow - i) + " ряд  " + (j) + " место  " + " цена " + room[i][j].Cost + " грн";
                    room[i][j].butt.ToolTip = tt;
                    kino.Children.Add(room[i][j].butt);

                }

            }

            string tmp = "";

            using (StreamReader file = File.OpenText(@"../films/" + namef + ".txt"))
            {
                while (file.Peek() >= 0)
                {
                    tmp += file.ReadLine();
                }
            }
            Info.Text = tmp;

            ImageSourceConverter imgs = new ImageSourceConverter();
            FAce.SetValue(Image.SourceProperty, imgs.ConvertFromString(@"../films/" + namef + ".jpg"));
            screen.SetValue(Image.SourceProperty, imgs.ConvertFromString(@"../timer/im.png"));
        }