예제 #1
0
        public MoviePlanSelectorPanel(MovieObject movie, DateTime dt)
        {
            InitializeComponent();
            this.movie = movie;
            this.dt    = dt;

            this.btnToday.Image    = Properties.Resources.BuyTicket_Select_Day_Two;
            this.btnTomorrow.Image = Properties.Resources.BuyTicket_Select_Day_Two;
            this.btnThreeDay.Image = Properties.Resources.BuyTicket_Select_Day_Two;
            TimeSpan ts = dt.Subtract(System.DateTime.Now.AddHours(-1));

            if (ts.Days == 0)
            {
                btnToday.Image = Properties.Resources.BuyTicket_Select_Day_Today;
            }
            else if (ts.Days == 1)
            {
                btnTomorrow.Image = Properties.Resources.BuyTicket_Select_Day_Today;
            }
            else
            {
                btnThreeDay.Image = Properties.Resources.BuyTicket_Select_Day_Today;
            }
            CheckForIllegalCrossThreadCalls = false;
        }
예제 #2
0
 public MoviePlanSelectorPanel(MovieObject movie)
 {
     InitializeComponent();
     this.movie = movie;
     this.dt    = System.DateTime.Now;
     CheckForIllegalCrossThreadCalls = false;
 }
예제 #3
0
 public CosumeDetailPanel(List <TicketPrintObject> tickets, MovieObject movie, MoviePlanObject moviePlan)
 {
     InitializeComponent();
     this.lists     = tickets;
     this.movieInfo = movie;
     this.moviePlan = moviePlan;
     this.InitMovieInfo();
 }
예제 #4
0
        public BluRayDiscMovie(IDirectoryAbstraction source)
        {
            RootDirectory = source;
            if (!source.TestForSubdirectory("BDMV"))
            {
                throw new DirectoryNotFoundException("BDMV directory not found!");
            }
            IDirectoryAbstraction bdmvRoot = source.OpenSubdirectory("BDMV");

            if (!bdmvRoot.TestForFile("index.bdmv"))
            {
                throw new FileNotFoundException("BDMV index not found!", "index.bdmv");
            }
            byte[] indexBdmv = bdmvRoot.ReadFileCompletely("index.bdmv");
            Index = new Index(indexBdmv);

            if (Index.HasMovieObjects())
            {
                byte[] movieObjectBdmv = bdmvRoot.ReadFileCompletely("MovieObject.bdmv");
                MovieObject = new MovieObject(movieObjectBdmv);
                bool playlistDirExists = bdmvRoot.TestForSubdirectory("PLAYLIST");

                if (MovieObject.HasPlaylistDependencies() && playlistDirExists)
                {
                    ReadOnlyCollection <uint> readOnlyCollection = MovieObject.GetPlaylistDependencies();
                    Playlists = new Playlist[readOnlyCollection.Count];
                    IDirectoryAbstraction playlistDir = bdmvRoot.OpenSubdirectory("PLAYLIST");
                    for (int i = 0; i < readOnlyCollection.Count; i++)
                    {
                        string fname = String.Format("{0:00000}.mpls", readOnlyCollection[i]);
                        if (!playlistDir.TestForFile(fname))
                        {
                            continue;
                        }
                        byte[] mplsBuffer = playlistDir.ReadFileCompletely(fname);
                        Playlists[i] = new Playlist(mplsBuffer, i);
                    }
                }
            }

            if (bdmvRoot.TestForSubdirectory("CLIPINF"))
            {
                IDirectoryAbstraction clipInfoDir = bdmvRoot.OpenSubdirectory("CLIPINF");
                string[] listFiles = clipInfoDir.ListFiles();
                Array.Sort(listFiles);
                Clips = Array.ConvertAll(listFiles, x => new ClipInfo(clipInfoDir.ReadFileCompletely(x), int.Parse(Path.GetFileNameWithoutExtension(x))));
            }

            if (source.TestForSubdirectory("CERTIFICATE"))
            {
                IDirectoryAbstraction certificate = source.OpenSubdirectory("CERTIFICATE");
                if (certificate.TestForFile("id.bdmv"))
                {
                    byte[] idBdmv = certificate.ReadFileCompletely("id.bdmv");
                    Id = new Id(idBdmv);
                }
            }
        }
예제 #5
0
        void lb_MouseHover(object sender, EventArgs e)
        {
            Control     ctr   = sender as Control;
            MovieObject movie = ctr.Tag as MovieObject;

            //this.toolTip1.to
            this.toolTip1.Tag = movie.Name.ToString();
            this.toolTip1.SetToolTip(ctr, movie.Name.ToString());
        }
예제 #6
0
        void pc_Click(object sender, EventArgs e)
        {
            if (loaded)
            {
                PictureBox  pic   = sender as PictureBox;
                MovieObject movie = pic.Tag as MovieObject;

                GlobalTools.GoPanel(new MoviePlanSelectorPanel(movie, tmpDt));
            }
        }
예제 #7
0
 public MovieSeatSelectorPanel(RoomPlanObject roomPlan, MovieObject movie, MoviePlanObject moviePlan, DateTime dt)
 {
     InitializeComponent();
     this.roomPlan  = roomPlan;
     this.movie     = movie;
     this.dt        = dt;
     this.moviePlan = moviePlan;
     CheckForIllegalCrossThreadCalls = false;
     this.SetOperationTime(60);
 }
예제 #8
0
        public ConfirmPayPwdPanel(List <TicketPrintObject> tickets, MovieObject movie, MoviePlanObject moviePlan, RoomPlanObject roomPlan, DateTime dt)
        {
            InitializeComponent();
            this.lists = tickets;

            this.movieInfo = movie;
            this.roomPlan  = roomPlan;
            this.moviePlan = moviePlan;
            this.dt        = dt;
        }
예제 #9
0
 public WaitTicketPrintPanel(List <TicketPrintObject> tickets, MovieObject movie, MoviePlanObject moviePlan)
 {
     InitializeComponent();
     CheckForIllegalCrossThreadCalls = false;
     this.AutoScroll = true;
     this.lists      = tickets;
     this.SetSepartor(false);
     this.movieInfo = movie;
     this.moviePlan = moviePlan;
     this.InitMovieInfo();
 }
 public void Verify_Add_Should_AddTheEntityToTheContext()
 {
     // Arrange
     Mock<IDbSet<MovieObject>> mockSetMovieObjects;
     var mockContext = MovieObjectsMockingSetup.DoMockingSetupForContext(false, out mockSetMovieObjects);
     var repository = new MovieObjectsRepository(mockContext.Object);
     var movieObjects = new MovieObject { Active = true, CustomKey = "SALVATORE-RAA", };
     // Act
     repository.Add(movieObjects);
     // Assert
     mockSetMovieObjects.Verify(x => x.Add(movieObjects), Times.Once);
 }
        public void Verify_Add_Should_AddTheEntityToTheContext()
        {
            // Arrange
            Mock <IDbSet <MovieObject> > mockSetMovieObjects;
            var mockContext  = MovieObjectsMockingSetup.DoMockingSetupForContext(false, out mockSetMovieObjects);
            var repository   = new MovieObjectsRepository(mockContext.Object);
            var movieObjects = new MovieObject {
                Active = true, CustomKey = "SALVATORE-RAA",
            };

            // Act
            repository.Add(movieObjects);
            // Assert
            mockSetMovieObjects.Verify(x => x.Add(movieObjects), Times.Once);
        }
예제 #12
0
        public void Verify_MapToEntity_WithExistingEntity_AssignsMovieObjectProperties()
        {
            // Arrange
            var mapper = new MovieObjectMapper();
            var model  = MovieObjectsMockingSetup.DoMockingSetupForMovieObjectModel();
            // Act
            IMovieObject existingEntity = new MovieObject {
                Id = 1
            };

            mapper.MapToEntity(model.Object, ref existingEntity);
            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.MovieId, existingEntity.MovieId);
            Assert.Equal(model.Object.ObjectId, existingEntity.ObjectId);
            // Associated Objects
            // <None>
        }
예제 #13
0
        private void Description_DragDrop(DragEventArgs args)
        {
            if (!args.Data.GetDataPresent(typeof(WriteableBitmap)))
            {
                return;
            }
            var data = args.Data.GetData(typeof(WriteableBitmap)) as BitmapSource;

            if (data == null)
            {
                return;
            }
            var fe = args.OriginalSource as FrameworkElement;

            if (fe == null)
            {
                return;
            }
            var target = fe.DataContext as ObjectGroup;

            if (target == null)
            {
                return;
            }

            var obj = new MovieObject();
            var img = new MovieObjectImage(data)
            {
                Visible = true
            };

            obj.Images.Add(img);
            var currentMsg = Repository.Get(typeof(SelectedMessage)) as SelectedMessage;

            currentMsg.message.AddCommand(new MovieCommand.AddObject(img));

            var objList = Repository.Get(typeof(MovieObjectList)) as MovieObjectList;

            objList.Add(obj);
            MovieObjects.Add(obj);
        }
예제 #14
0
        void wc_DownloadStringCompleted(object sender, System.Net.DownloadStringCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                return;
            }
            var type = JObject.Parse(e.Result).SelectToken("type").ToString();
            var id   = JObject.Parse(e.Result).SelectToken("id").ToString();

            postAnswer.Add("access_token", App.AccessToken);
            postAnswer.Add("id", id);
            switch (type)
            {
            case "hometown":
                hometown = JsonConvert.DeserializeObject <HometownObject>(e.Result);
                setHometown();
                break;

            case "music":
                music = JsonConvert.DeserializeObject <MusicObject>(e.Result);
                setMusic();
                break;

            case "book":
                book = JsonConvert.DeserializeObject <BookObject>(e.Result);
                setBook();
                break;

            case "movie":
                movie = JsonConvert.DeserializeObject <MovieObject>(e.Result);
                setMovie();
                break;

            case "photo":
                photo = JsonConvert.DeserializeObject <PhotoObject>(e.Result);
                setPhoto();
                break;
            }
        }
예제 #15
0
 /// <summary>
 /// 定时刷新影片显示内容
 /// </summary>
 public static void RefreshMovieShowList()
 {
     lock (synObj)
     {
         MovieShowList.Clear();
         DirectoryInfo dir = new DirectoryInfo("MovieShows");
         if (dir != null)
         {
             FileInfo[]  files = dir.GetFiles();
             MovieObject movie = null;
             Image       img   = null;
             for (int i = 0; i < files.Length; i++)
             {
                 img           = Image.FromFile(files[i].FullName);
                 movie         = new MovieObject();
                 movie.AdImage = (Image)img.Clone();
                 movie.Name    = files[i].Name;
                 MovieShowList.Add(movie);
             }
         }
     }
     //FileInfo
 }
 public void Verify_MapToEntity_WithExistingEntity_AssignsMovieObjectProperties()
 {
     // Arrange
     var mapper = new MovieObjectMapper();
     var model = MovieObjectsMockingSetup.DoMockingSetupForMovieObjectModel();
     // Act
     IMovieObject existingEntity = new MovieObject { Id = 1 };
     mapper.MapToEntity(model.Object, ref existingEntity);
     // Assert
     // <None>
     // Related Objects
     Assert.Equal(model.Object.MovieId, existingEntity.MovieId);
     Assert.Equal(model.Object.ObjectId, existingEntity.ObjectId);
     // Associated Objects
     // <None>
 }
예제 #17
0
        public UserPayCheckPanel(List <TicketPrintObject> tickets, MovieObject movie, MoviePlanObject moviePlan, RoomPlanObject roomPlan, DateTime dt)
        {
            InitializeComponent();
            this.SetSepartor(false);

            this.lists     = tickets;
            this.movieInfo = movie;
            this.moviePlan = moviePlan;
            this.roomPlan  = roomPlan;
            this.dt        = dt;
            if (tickets != null)
            {
                TicketPrintObject ticket = tickets[0];
                this.picAdImage.Image = movieInfo.AdImage;
                //ticket.MovieName = "假如真的是爱情有天意的话";
                if (ticket.MovieName.Length > 9)
                {
                    this.lbMovieName.Text     = ticket.MovieName.Substring(0, 9) + "\n" + ticket.MovieName.Substring(9);
                    this.lbMovieInfo.Location = new Point(this.lbMovieName.Location.X, this.lbMovieName.Location.Y + this.lbMovieName.Height + 2);
                }
                else
                {
                    this.lbMovieName.Text = ticket.MovieName;
                }
                this.lbMovieInfo.Text = string.Format(this.lbMovieInfo.Text, moviePlan.Type, moviePlan.Language, movieInfo.TotalMinutes);
                //DateTime  playDate=Convert.ToDateTime(ticket.PlayDate);
                // DateTime playDate = movie.PlayTime;
                DateTime playDate = dt;
                this.lbDate.Text = playDate.ToString("MM月dd日") + " " + DateTimeHelper.GetChineseXq(playDate);
                WinFormHelper.LocationAfter(this.lbDate, this.lbDateHint);

                this.lbTime.Text = ticket.PlayTime;
                WinFormHelper.LocationAfter(this.lbDateHint, this.lbTime);
                WinFormHelper.LocationAfter(this.lbTime, this.lbTimeHint);

                this.lbRoom.Text = ticket.RoomName;
                WinFormHelper.LocationAfter(this.lbTimeHint, this.lbRoom);

                //this.lbRoom.Location = new Point(this.lbTimeHint.Location.X + this.lbTimeHint.Width, this.lbTimeHint.Location.Y);

                int    num  = 6;
                string seat = string.Empty;
                for (int i = 0; i < lists.Count; i++)
                {
                    if (i != 0 && i % num == 0)
                    {
                        // seat += "\n座位:"
                        seat += "\n          ";
                    }
                    seat += lists[i].Seat + " ";
                }
                this.lbSeats.Text       = string.Format(this.lbSeats.Text, seat);
                this.lbTicketPrice.Text = ticket.Price.ToString();
                WinFormHelper.LocationAfter(this.lbTicketPrice, this.lbTicketPriceHint);
                this.lbTicketCount.Text = this.lists.Count.ToString();
                WinFormHelper.LocationAfter(this.lbTicketPriceHint, this.lbTicketCount);
                WinFormHelper.LocationAfter(this.lbTicketCount, this.lbTicketCountHint);
                this.lbTicketTotalPrice.Text = (ticket.Price * this.lists.Count).ToString();
                WinFormHelper.LocationAfter(this.lbTicketTotalPrice, this.lbTicketTotalPriceHint);
            }
            this.SetOperationTime(30);
        }
예제 #18
0
 internal void Add(MovieObject img)
 {
     MovieObjects.Add(img);
 }