コード例 #1
0
ファイル: Form1.cs プロジェクト: rNdm74/C-
        private void bClear_Click(object sender, EventArgs e)
        {
            // Clear all data
            lTicketPrice.Text = "$0.00";
            lAllocatedSeating.Text = "";
            //season.AllocatedSeats = 0;
            //door.AllocatedSeats = 0;
            gallerySeating = new bool[CONSTS.COLS, CONSTS.GALLERY.Length];
            godsSeating = new bool[CONSTS.COLS, CONSTS.GODS.Length];

            season = new Season(lAllocatedSeating, gallerySeating);
            door = new Door(lAllocatedSeating, godsSeating);
            allocateSeatSubject.Clear();
            allocateSeatSubject.AddObserver(new Gallery(canvasGallery, canvasGalleryRows, canvasGallerySeats, gallerySeating));
            allocateSeatSubject.AddObserver(new Gods(canvasGods, canvasGodsRows, canvasGodsSeats, godsSeating));
            allocateSeatSubject.NotifyObservers();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: rNdm74/C-
        private void Form1_Load(object sender, EventArgs e)
        {
            // Set canvas for regent seating display
            canvasGallery = pSeatingDisplayGallery.CreateGraphics();
            canvasGalleryRows = pGalleryRows.CreateGraphics();
            canvasGallerySeats = pGallerySeats.CreateGraphics();
            canvasGods = pSeatingDisplayGods.CreateGraphics();
            canvasGodsRows = pGodsRows.CreateGraphics();
            canvasGodsSeats = pGodsSeats.CreateGraphics();

            // Create subject
            allocateSeatSubject = new Subject();
            allocateSeatSubject.AddObserver(new Gallery(canvasGallery, canvasGalleryRows, canvasGallerySeats, gallerySeating));
            allocateSeatSubject.AddObserver(new Gods(canvasGods, canvasGodsRows, canvasGodsSeats, godsSeating));

            // Create intefaces
            season = new Season(lAllocatedSeating, gallerySeating);
            door = new Door(lAllocatedSeating, godsSeating);
        }