示例#1
0
        private void RefreshMovieBindings()
        {
            this.layoutControl1.Enabled = !MovieDBFactory.IsMultiSelected;

            if (MovieDBFactory.IsMultiSelected)
            {
                return;
            }

            xmlPreviewMediaInfoOutput.Clear();
            cmbFiles.Properties.Items.Clear();
            foreach (var file in MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media)
            {
                cmbFiles.Properties.Items.Add(file.PathAndFilename);
            }

            cmbFiles.SelectedIndex = 0;

            if (MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media.Count > 0)
            {
                PopulateMediaInfoModel(MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media[0].MiResponseModel);
            }

            PopulateFileInfo();
        }
示例#2
0
 private static void StartMovieFile()
 {
     if (File.Exists(MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media[0].PathAndFilename))
     {
         Process.Start(MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media[0].PathAndFilename);
     }
 }
示例#3
0
        /// <summary>
        /// Setup Data Bindings
        /// </summary>
        private void SetupBindings()
        {
            txtImdbID.DataBindings.Clear();
            txtImdbID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "ImdbId");

            txtTmdbId.DataBindings.Clear();
            txtTmdbId.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "TmdbId");

            txtAllocineID.DataBindings.Clear();
            txtAllocineID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "AllocineId");

            txtFilmAffinityID.DataBindings.Clear();
            txtFilmAffinityID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmAffinityId");

            txtFilmDeltaID.DataBindings.Clear();
            txtFilmDeltaID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmDeltaId");

            txtFilmUpID.DataBindings.Clear();
            txtFilmUpID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmUpId");

            txtFilmWebID.DataBindings.Clear();
            txtFilmWebID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmWebId");

            txtImpawardsID.DataBindings.Clear();
            txtImpawardsID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "ImpawardsId");

            txtKinopoiskID.DataBindings.Clear();
            txtKinopoiskID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "KinopoiskId");
        }
示例#4
0
 /// <summary>
 /// Handles the CurrentMovieChanged event of the MovieDBFactory control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void MovieDBFactory_CurrentMovieChanged(object sender, EventArgs e)
 {
     if (this.layoutControl1.TabIndex == 0)
     {
         AddColouredText(MovieDBFactory.GetCurrentMovie().YamjXml, this.rtbYAMJ);
     }
 }
        /// <summary>
        /// Handles the ItemClick event of the btnGetImageFromUrl control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DevExpress.XtraBars.ItemClickEventArgs"/> instance containing the event data.</param>
        private void BtnGetImageFromUrl_ItemClick(object sender, ItemClickEventArgs e)
        {
            var enterUrl = new FrmEnterAValue("Enter a URL");

            enterUrl.ShowDialog();

            if (!string.IsNullOrEmpty(enterUrl.Response))
            {
                switch (this.galleryType)
                {
                case GalleryType.MovieFanart:
                    MovieDBFactory.GetCurrentMovie().FanartPathOnDisk      = string.Empty;
                    MovieDBFactory.GetCurrentMovie().CurrentFanartImageUrl = enterUrl.Response;
                    this.ProcessMovieFanartDownload();
                    break;

                case GalleryType.MoviePoster:
                    MovieDBFactory.GetCurrentMovie().PosterPathOnDisk      = string.Empty;
                    MovieDBFactory.GetCurrentMovie().CurrentPosterImageUrl = enterUrl.Response;
                    this.ProcessMoviePosterDownload();
                    break;

                case GalleryType.TvSeriesBanner:
                    TvDBFactory.CurrentSeries.SeriesBannerUrl = enterUrl.Response;
                    this.ProcessSeriesBannerDownload();
                    break;

                case GalleryType.TvSeriesPoster:
                    TvDBFactory.CurrentSeries.PosterUrl = string.Empty;
                    this.ProcessSeriesPosterDownload();
                    break;

                case GalleryType.TvSeriesFanart:
                    TvDBFactory.CurrentSeries.FanartUrl = string.Empty;
                    this.ProcessSeriesFanartDownload();
                    break;

                case GalleryType.TvSeasonBanner:
                    TvDBFactory.CurrentSeason.BannerUrl = string.Empty;
                    this.ProcessSeasonBannerDownload();
                    break;

                case GalleryType.TvSeasonFanart:
                    TvDBFactory.CurrentSeason.FanartUrl = string.Empty;
                    this.ProcessSeasonFanartDownload();
                    break;

                case GalleryType.TvSeasonPoster:
                    TvDBFactory.CurrentSeason.PosterUrl = string.Empty;
                    this.ProcessSeasonPosterDownload();
                    break;

                case GalleryType.TvEpisodeScreenshot:
                    TvDBFactory.CurrentEpisode.EpisodeScreenshotUrl = string.Empty;
                    this.ProcessEpisodeScreenshotDownload();
                    break;
                }
            }
        }
        private void UpdateImagePath(string fileName)
        {
            switch (this.galleryType)
            {
            case GalleryType.MoviePoster:
                MovieDBFactory.GetCurrentMovie().PosterPathOnDisk      = fileName;
                MovieDBFactory.GetCurrentMovie().CurrentPosterImageUrl = string.Empty;
                this.MovieDBFactory_PosterLoaded(this, new EventArgs());
                break;

            case GalleryType.MovieFanart:
                MovieDBFactory.GetCurrentMovie().FanartPathOnDisk      = fileName;
                MovieDBFactory.GetCurrentMovie().CurrentFanartImageUrl = string.Empty;
                this.MovieDBFactory_FanartLoaded(this, new EventArgs());
                break;

            case GalleryType.TvSeriesPoster:
                TvDBFactory.CurrentSeries.PosterPath = fileName;
                TvDBFactory.CurrentSeries.PosterUrl  = string.Empty;
                this.TvDbFactory_SeriesPosterLoaded(this, new EventArgs());
                break;

            case GalleryType.TvSeriesFanart:
                TvDBFactory.CurrentSeries.FanartPath = fileName;
                TvDBFactory.CurrentSeries.FanartUrl  = string.Empty;
                this.TvDbFactory_SeriesFanartLoaded(this, new EventArgs());
                break;

            case GalleryType.TvSeriesBanner:
                TvDBFactory.CurrentSeries.SeriesBannerPath = fileName;
                TvDBFactory.CurrentSeries.SeriesBannerUrl  = string.Empty;
                this.TvDbFactory_SeriesFanartLoaded(this, new EventArgs());
                break;

            case GalleryType.TvSeasonPoster:
                TvDBFactory.CurrentSeason.PosterPath = fileName;
                TvDBFactory.CurrentSeason.PosterUrl  = string.Empty;
                this.TvDBFactory_SeasonPosterLoaded(this, new EventArgs());
                break;

            case GalleryType.TvSeasonFanart:
                TvDBFactory.CurrentSeason.FanartPath = fileName;
                TvDBFactory.CurrentSeason.FanartUrl  = string.Empty;
                this.TvDBFactory_SeasonFanartLoaded(this, new EventArgs());
                break;

            case GalleryType.TvSeasonBanner:
                TvDBFactory.CurrentSeason.BannerPath = fileName;
                TvDBFactory.CurrentSeason.BannerUrl  = string.Empty;
                this.TvDBFactory_SeasonBannerLoaded(this, new EventArgs());
                break;

            case GalleryType.TvEpisodeScreenshot:
                TvDBFactory.CurrentEpisode.EpisodeScreenshotPath = fileName;
                TvDBFactory.CurrentEpisode.EpisodeScreenshotUrl  = string.Empty;
                this.TvDBFactory_SeasonBannerLoaded(this, new EventArgs());
                break;
            }
        }
示例#7
0
        /// <summary>
        /// Handles the DoubleClick event of the BtnNew control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BtnNew_DoubleClick(object sender, EventArgs e)
        {
            var button = sender as SimpleButton;

            MovieDBFactory.GetCurrentMovie().IsNew = false;

            button.Visible = false;
        }
        /// <summary>
        /// The set movie binding.
        /// </summary>
        private void SetMovieBinding()
        {
            this.imageMain.DataBindings.Clear();
            this.imageMain.Image = Resources.picturefaded128;

            layoutControl2.DataBindings.Clear();
            layoutControl2.DataBindings.Add("Enabled", MovieDBFactory.GetCurrentMovie(), "Unlocked");

            hideContainerLeft.DataBindings.Clear();
            hideContainerLeft.DataBindings.Add("Enabled", MovieDBFactory.GetCurrentMovie(), "Unlocked");

            switch (this.galleryType)
            {
            case GalleryType.MoviePoster:

                if (!string.IsNullOrEmpty(MovieDBFactory.GetCurrentMovie().PosterPathOnDisk))
                {
                    this.MovieDBFactory_PosterLoaded(null, null);
                }
                else
                {
                    this.ProcessMoviePosterDownload();
                }

                if (this.populateGallery)
                {
                    this.galleryControl.Gallery.Groups.Clear();
                    this.galleryControl.Gallery.ImageSize = new Size(100, 160);
                    this.galleryControl.Gallery.Groups.Add(MovieDBFactory.GetCurrentMovie().PosterAltGallery);
                    this.populateGallery = false;
                }

                break;

            case GalleryType.MovieFanart:

                if (!string.IsNullOrEmpty(MovieDBFactory.GetCurrentMovie().FanartPathOnDisk))
                {
                    this.MovieDBFactory_FanartLoaded(null, null);
                }
                else
                {
                    this.ProcessMovieFanartDownload();
                }

                if (this.populateGallery)
                {
                    this.galleryControl.Gallery.Groups.Clear();
                    this.galleryControl.Gallery.Groups.Add(MovieDBFactory.GetCurrentMovie().FanartAltGallery);
                    this.populateGallery = false;
                    this.galleryControl.Gallery.ImageSize = new Size(100, 60);
                }



                break;
            }
        }
        /// <summary>
        /// Handles the ItemClick event of the galleryControlGallery1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DevExpress.XtraBars.Ribbon.GalleryItemClickEventArgs"/> instance containing the event data.</param>
        private void GalleryControlGallery1_ItemClick(object sender, GalleryItemClickEventArgs e)
        {
            var type = e.Item.Tag.ToString().Split('|')[0];
            var url  = e.Item.Tag.ToString().Split('|')[1];

            switch (type)
            {
            case "moviePoster":
                MovieDBFactory.GetCurrentMovie().PosterPathOnDisk      = string.Empty;
                MovieDBFactory.GetCurrentMovie().CurrentPosterImageUrl = url;
                this.SetMovieBinding();
                break;

            case "movieFanart":
                MovieDBFactory.GetCurrentMovie().FanartPathOnDisk      = string.Empty;
                MovieDBFactory.GetCurrentMovie().CurrentFanartImageUrl = url;
                this.SetMovieBinding();
                break;

            case "tvSeriesFanart":
                TvDBFactory.CurrentSeries.FanartPath = string.Empty;
                TvDBFactory.CurrentSeries.FanartUrl  = url;
                this.SetTvSeriesBinding();
                break;

            case "tvSeriesPoster":
                TvDBFactory.CurrentSeries.PosterPath = string.Empty;
                TvDBFactory.CurrentSeries.PosterUrl  = url;
                this.SetTvSeriesBinding();
                break;

            case "tvSeriesBanner":
                TvDBFactory.CurrentSeries.SeriesBannerPath = string.Empty;
                TvDBFactory.CurrentSeries.SeriesBannerUrl  = url;
                this.SetTvSeriesBinding();
                break;

            case "tvSeasonFanart":
                TvDBFactory.CurrentSeason.FanartPath = string.Empty;
                TvDBFactory.CurrentSeason.FanartUrl  = url;
                this.SetTvSeasonBinding();
                break;

            case "tvSeasonPoster":
                TvDBFactory.CurrentSeason.PosterPath = string.Empty;
                TvDBFactory.CurrentSeason.PosterUrl  = url;
                this.SetTvSeasonBinding();
                break;

            case "tvSeasonBanner":
                TvDBFactory.CurrentSeason.BannerPath = string.Empty;
                TvDBFactory.CurrentSeason.BannerUrl  = url;
                this.SetTvSeasonBinding();
                break;
            }
        }
示例#10
0
        private static void OpenMovieFolder()
        {
            string argument = string.Format(
                @"/select,""{0}""",
                File.Exists(MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media[0].PathAndFilename)
                    ? MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media[0].PathAndFilename
                    : MovieDBFactory.GetCurrentMovie().AssociatedFiles.Media[0].FolderPath);

            Process.Start("explorer.exe", argument);
        }
示例#11
0
        /// <summary>
        /// Handles the CurrentMovieChanged event of the MovieDBFactory control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MovieDBFactory_CurrentMovieChanged(object sender, EventArgs e)
        {
            this.btnLock.DataBindings.Clear();
            this.btnMarked.DataBindings.Clear();

            this.btnLock.DataBindings.Add("Image", MovieDBFactory.GetCurrentMovie(), "LockedImage", true, DataSourceUpdateMode.OnPropertyChanged);
            this.btnMarked.DataBindings.Add("Image", MovieDBFactory.GetCurrentMovie(), "MarkedImage", true, DataSourceUpdateMode.OnPropertyChanged);

            this.btnNew.Visible = MovieDBFactory.GetCurrentMovie().IsNew;
        }
示例#12
0
        /// <summary>
        /// Determines whether [is ready for scrape].
        /// </summary>
        /// <returns>
        ///   <c>true</c> if [is ready for scrape]; otherwise, <c>false</c>.
        /// </returns>
        private bool IsReadyForScrape()
        {
            if (string.IsNullOrEmpty(MovieDBFactory.GetCurrentMovie().ImdbId))
            {
                InternalApps.Logs.Log.WriteToLog(LogSeverity.Warning, 0, "Scrape fail", "No IMDB ID found for " + MovieDBFactory.GetCurrentMovie().Title);
                XtraMessageBox.Show("No IMDB ID Found for this movie");

                return(false);
            }

            return(true);
        }
示例#13
0
        /// <summary>
        /// Handles the DoWork event of the bgw control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param>
        private void bgw_DoWork(object sender, DoWorkEventArgs e)
        {
            var results = new BindingList <QueryResult>();
            var query   = new Query
            {
                Results = results,
                Title   = MovieDBFactory.GetCurrentMovie().Title,
                Year    = MovieDBFactory.GetCurrentMovie().Year.ToString()
            };

            Factories.Scraper.MovieScrapeFactory.QuickSearchTmdb(query);

            e.Result = query;
        }
示例#14
0
        /// <summary>
        /// Handles the Click event of the btnLoadFromWeb control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnLoadFromWeb_Click(object sender, EventArgs e)
        {
            MovieDBFactory.InvokeCurrentMovieValueChanged(new EventArgs());

            var count = MovieDBFactory.MovieDatabase.Count;

            if (count == 1)
            {
                Factories.Scraper.MovieScrapeFactory.RunSingleScrape(MovieDBFactory.GetCurrentMovie());
            }
            else if (count > 1)
            {
                Factories.Scraper.MovieScrapeFactory.RunMultiScrape(MovieDBFactory.MultiSelectedMovies);
            }
        }
        /// <summary>
        /// Processes the movie poster download.
        /// </summary>
        private void ProcessMoviePosterDownload()
        {
            if (Downloader.Downloading.Contains(MovieDBFactory.GetCurrentMovie().CurrentPosterImageUrl))
            {
                return;
            }

            MovieDBFactory.PosterLoading += this.ImageLoading;
            MovieDBFactory.PosterLoaded  += this.MovieDBFactory_PosterLoaded;

            if (!string.IsNullOrEmpty(MovieDBFactory.GetCurrentMovie().CurrentPosterImageUrl))
            {
                MovieDBFactory.GetPoster();
            }
        }
示例#16
0
        /// <summary>
        /// Handles the Click event of the btnLoadFromWeb control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BtnLoadFromWeb_Click(object sender, EventArgs e)
        {
            grdViewByTitle.RefreshData();

            var count = grdViewByTitle.SelectedRowsCount;

            if (count == 1)
            {
                Factories.Scraper.MovieScrapeFactory.RunSingleScrape(MovieDBFactory.GetCurrentMovie());
            }
            else if (count > 1)
            {
                Factories.Scraper.MovieScrapeFactory.RunMultiScrape(MovieDBFactory.MultiSelectedMovies);
            }
        }
        /// <summary>
        /// Processes the movie fanart download.
        /// </summary>
        private void ProcessMovieFanartDownload()
        {
            if (Downloader.Downloading.Contains(MovieDBFactory.GetCurrentMovie().CurrentFanartImageUrl))
            {
                return;
            }

            MovieDBFactory.FanartLoading += this.ImageLoading;
            MovieDBFactory.FanartLoaded  += this.MovieDBFactory_FanartLoaded;

            if (!string.IsNullOrEmpty(MovieDBFactory.GetCurrentMovie().CurrentFanartImageUrl))
            {
                MovieDBFactory.GetFanart();
            }
        }
        /// <summary>
        /// The set movie binding.
        /// </summary>
        private void SetMovieBinding()
        {
            this.imageMain.DataBindings.Clear();
            this.imageMain.Image = Resources.picturefaded128;

            switch (this.galleryType)
            {
            case GalleryType.MoviePoster:

                if (this.populateGallery)
                {
                    this.galleryControl.Gallery.ImageSize = new Size(100, 160);
                    this.galleryControl.Gallery.Groups.Clear();
                }

                if (!string.IsNullOrEmpty(MovieDBFactory.GetCurrentMovie().PosterPathOnDisk))
                {
                    this.MovieDBFactory_PosterLoaded(null, null);
                    return;
                }

                this.ProcessMoviePosterDownload();

                break;

            case GalleryType.MovieFanart:

                if (this.populateGallery)
                {
                    this.galleryControl.Gallery.ImageSize = new Size(100, 60);
                    this.galleryControl.Gallery.Groups.Clear();
                }

                if (!string.IsNullOrEmpty(MovieDBFactory.GetCurrentMovie().FanartPathOnDisk))
                {
                    this.MovieDBFactory_FanartLoaded(null, null);
                    return;
                }

                this.ProcessMovieFanartDownload();

                break;
            }
        }
示例#19
0
 private void grdViewTrailers_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     for (int i = 0; i < grdViewTrailers.RowCount; i++)
     {
         if (i != e.RowHandle)
         {
             ((TrailerDetailsModel)grdViewTrailers.GetRow(i)).SelectedTrailer = false;
         }
         else if (((TrailerDetailsModel)grdViewTrailers.GetRow(i)).SelectedTrailer)
         {
             MovieDBFactory.GetCurrentMovie().CurrentTrailerUrl =
                 ((TrailerDetailsModel)grdViewTrailers.GetRow(i)).UriFull.ToString();
         }
         else if (!((TrailerDetailsModel)grdViewTrailers.GetRow(i)).SelectedTrailer)
         {
             MovieDBFactory.GetCurrentMovie().CurrentTrailerUrl = string.Empty;
         }
     }
 }
示例#20
0
        /// <summary>
        /// Handles the BeforePopup event of the popupLoadFromWeb control.
        /// </summary>
        /// <param name="sender">
        /// The source of the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.
        /// </param>
        private void popupLoadFromWeb_BeforePopup(object sender, CancelEventArgs e)
        {
            this.popupLoadFromWeb.ClearLinks();

            var barItemLink = new BarButtonItem(
                this.barManager1, "Scrape using " + MovieDBFactory.GetCurrentMovie().ScraperGroup);

            barItemLink.Tag        = MovieDBFactory.GetCurrentMovie().ScraperGroup;
            barItemLink.ItemClick += this.barItemLink_ItemClick;
            this.popupLoadFromWeb.AddItem(barItemLink);

            foreach (var scraper in MovieScraperGroupFactory.GetScraperGroupsOnDisk())
            {
                barItemLink            = new BarButtonItem(this.barManager1, "Use " + scraper);
                barItemLink.Tag        = MovieDBFactory.GetCurrentMovie().ScraperGroup;
                barItemLink.ItemClick += this.barItemLink_ItemClick;
                this.popupLoadFromWeb.AddItem(barItemLink);
            }
        }
        /// <summary>
        /// Handles the PosterLoaded event of the MovieDBFactory control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MovieDBFactory_PosterLoaded(object sender, EventArgs e)
        {
            Image image = MovieDBFactory.LoadPoster();

            if (image == null)
            {
                this.populateGallery = false;
                this.StopLoading();
                return;
            }

            this.StopLoading();
            this.imageMain.Image = image;

            if (this.populateGallery)
            {
                this.galleryControl.Gallery.Groups.Add(MovieDBFactory.GetCurrentMovie().PosterAltGallery);
                this.populateGallery = false;
            }
        }
示例#22
0
        /// <summary>
        /// Setup Data Bindings
        /// </summary>
        private void SetupBindings()
        {
            foreach (IMovieScraper scraper in scrapers)
            {
                if (scraper.IncludeInWebIDList)
                {
                    var controls = layoutIds.Controls.Find("txtId" + scraper.ScraperName.ToString(), true);

                    controls[0].DataBindings.Clear();
                    controls[0].DataBindings.Add(
                        "Text", MovieDBFactory.GetCurrentMovie(), scraper.ScraperName.ToString() + "Id");
                }
            }

            //txtImdbID.DataBindings.Clear();
            //txtImdbID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "ImdbId");

            //txtTmdbId.DataBindings.Clear();
            //txtTmdbId.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "TmdbId");

            //txtAllocineID.DataBindings.Clear();
            //txtAllocineID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "AllocineId");

            //txtFilmAffinityID.DataBindings.Clear();
            //txtFilmAffinityID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmAffinityId");

            //txtFilmDeltaID.DataBindings.Clear();
            //txtFilmDeltaID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmDeltaId");

            //txtFilmUpID.DataBindings.Clear();
            //txtFilmUpID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmUpId");

            //txtFilmWebID.DataBindings.Clear();
            //txtFilmWebID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "FilmWebId");

            //txtImpawardsID.DataBindings.Clear();
            //txtImpawardsID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "ImpawardsId");

            //txtKinopoiskID.DataBindings.Clear();
            //txtKinopoiskID.DataBindings.Add("Text", MovieDBFactory.GetCurrentMovie(), "KinopoiskId");
        }
示例#23
0
        /// <summary>
        /// Handles the CurrentMovieChanged event of the MovieDBFactory control.
        /// </summary>
        /// <param name="sender">
        /// The source of the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.EventArgs"/> instance containing the event data.
        /// </param>
        private void MovieDBFactory_CurrentMovieChanged(object sender, EventArgs e)
        {
            this.btnLock.DataBindings.Clear();
            this.btnMarked.DataBindings.Clear();
            this.btnWatched.DataBindings.Clear();

            this.btnLoadFromWeb.DataBindings.Clear();
            this.btnLoadFromWeb.DataBindings.Add("Enabled", MovieDBFactory.GetCurrentMovie(), "Unlocked");

            this.btnLock.DataBindings.Add(
                "Image", MovieDBFactory.GetCurrentMovie(), "LockedImage", true, DataSourceUpdateMode.OnPropertyChanged);
            this.btnMarked.DataBindings.Add(
                "Image", MovieDBFactory.GetCurrentMovie(), "MarkedImage", true, DataSourceUpdateMode.OnPropertyChanged);

            this.btnNew.Visible = MovieDBFactory.GetCurrentMovie().IsNew;

            this.btnWatched.DataBindings.Add("Image", MovieDBFactory.GetCurrentMovie(), "WatchedImage");

            this.btnMediaInfo.DataBindings.Clear();

            this.btnMediaInfo.DataBindings.Add("Image", MovieDBFactory.GetCurrentMovie(), "MediaInfoImage");
        }
示例#24
0
        private void SetupMovieEventBinding()
        {
            MovieDBFactory.CurrentMovieChanged += (sender, e) =>
            {
                MovieDBFactory.GetCurrentMovie().MediaInfoChanged += (s, e2) =>
                {
                    if (this.InvokeRequired)
                    {
                        this.Invoke(new EventHandler(delegate(object o, EventArgs a)
                        {
                            this.PopulateFileInfo();
                        }));
                    }
                    else
                    {
                        this.PopulateFileInfo();
                    }
                };

                this.RefreshMovieBindings();
            };
        }
示例#25
0
 /// <summary>
 /// Handles the Click event of the BtnLock control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void BtnLock_Click(object sender, EventArgs e)
 {
     MovieDBFactory.GetCurrentMovie().Locked = !MovieDBFactory.GetCurrentMovie().Locked;
     grdViewByTitle.RefreshData();
 }
示例#26
0
        private void PopulateFileInfo()
        {
            FileInfoModel fileInfoModel;

            fileInfoModel = this.Type == FileInfoType.Movie ? MovieDBFactory.GetCurrentMovie().FileInfo : TvDBFactory.CurrentEpisode.FileInfo;

            grdAudioStreams.DataSource    = fileInfoModel.AudioStreams;
            grdSubtitleStreams.DataSource = fileInfoModel.SubtitleStreams;

            txtVideoCodec.DataBindings.Clear();
            txtVideoCodec.DataBindings.Add("Text", fileInfoModel, "Codec", true, DataSourceUpdateMode.OnPropertyChanged);
            txtVideoCodec.Refresh();

            txtWidth.DataBindings.Clear();
            txtWidth.DataBindings.Add("Text", fileInfoModel, "Width", true, DataSourceUpdateMode.OnPropertyChanged);
            txtWidth.Refresh();

            txtHeight.DataBindings.Clear();
            txtHeight.DataBindings.Add("Text", fileInfoModel, "Height", true, DataSourceUpdateMode.OnPropertyChanged);
            txtHeight.Refresh();

            txtFPSFull.DataBindings.Clear();
            txtFPSFull.DataBindings.Add("Text", fileInfoModel, "FPS");
            txtFPSFull.Refresh();

            txtFPSRounded.DataBindings.Clear();
            txtFPSRounded.DataBindings.Add("Text", fileInfoModel, "FPSRounded");
            txtFPSRounded.Refresh();

            cmbAspectRatioDecimal.DataBindings.Clear();
            cmbAspectRatioDecimal.DataBindings.Add("Text", fileInfoModel, "AspectRatioDecimal");
            cmbAspectRatioDecimal.Refresh();

            cmbAspectRatio.DataBindings.Clear();
            cmbAspectRatio.DataBindings.Add("Text", fileInfoModel, "AspectRatio");
            cmbAspectRatio.Refresh();

            txtResolution.DataBindings.Clear();
            txtResolution.DataBindings.Add("Text", fileInfoModel, "Resolution");
            txtResolution.Refresh();

            chkInterlaced.DataBindings.Clear();
            chkInterlaced.DataBindings.Add("Checked", fileInfoModel, "InterlacedScan");

            chkProgressive.DataBindings.Clear();
            chkProgressive.DataBindings.Add("Checked", fileInfoModel, "ProgressiveScan");

            chkPal.DataBindings.Clear();
            chkPal.DataBindings.Add("Checked", fileInfoModel, "Pal");

            chkNtsc.DataBindings.Clear();
            chkNtsc.DataBindings.Add("Checked", fileInfoModel, "Ntsc");

            if (this.Type == FileInfoType.Movie)
            {
                var currentMovie = MovieDBFactory.GetCurrentMovie();

                if (currentMovie.AssociatedFiles.Media.Count > 0 && currentMovie.AssociatedFiles.Media != null)
                {
                    xmlPreviewMediaInfoOutput.SetXML(currentMovie.AssociatedFiles.Media[0].ScanXML);
                }

                xmlPreview.SetXML(IO.GenerateOutput.AccessCurrentIOHandler().GetFileInfo(movie: currentMovie));
            }
            else
            {
                var currentEpisode = TvDBFactory.CurrentEpisode;

                xmlPreviewMediaInfoOutput.SetXML(currentEpisode.FilePath.MiResponseModel.ScanXML);

                xmlPreview.SetXML(IO.GenerateOutput.AccessCurrentIOHandler().GetFileInfo(episode: currentEpisode));
            }
        }
示例#27
0
 /// <summary>
 /// Handles the Click event of the BtnMarked control.
 /// </summary>
 /// <param name="sender">
 /// The source of the event.
 /// </param>
 /// <param name="e">
 /// The <see cref="System.EventArgs"/> instance containing the event data.
 /// </param>
 private void BtnMarked_Click(object sender, EventArgs e)
 {
     MovieDBFactory.GetCurrentMovie().Marked = !MovieDBFactory.GetCurrentMovie().Marked;
     this.grdViewByTitle.RefreshData();
 }
示例#28
0
 /// <summary>
 /// Setup Data Bindings
 /// </summary>
 private void SetupBindings()
 {
     grdTrailers.DataSource = null;
     grdTrailers.DataSource = MovieDBFactory.GetCurrentMovie().AlternativeTrailers;
 }
        /// <summary>
        /// Handles the ItemClick event of the btnGetImageFromDisk control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DevExpress.XtraBars.ItemClickEventArgs"/> instance containing the event data.</param>
        private void BtnGetImageFromDisk_ItemClick(object sender, ItemClickEventArgs e)
        {
            var dialog = new OpenFileDialog {
                Filter = @"Jpg (*.jpg)|*.jpg|All Files (*.*)|*.*"
            };

            const string Title = "Select {0} image from disk";

            switch (this.galleryType)
            {
            case GalleryType.MovieFanart:
                dialog.Title = string.Format(Title, "movie fanart");
                break;

            case GalleryType.MoviePoster:
                dialog.Title = string.Format(Title, "movie poster");
                break;

            case GalleryType.TvSeriesBanner:
                dialog.Title = string.Format(Title, "tv series banner");
                break;

            case GalleryType.TvSeriesPoster:
                dialog.Title = string.Format(Title, "tv series poster");
                break;

            case GalleryType.TvSeriesFanart:
                dialog.Title = string.Format(Title, "tv series fanart");
                break;

            case GalleryType.TvSeasonPoster:
                dialog.Title = string.Format(Title, "tv season poster");
                break;

            case GalleryType.TvSeasonFanart:
                dialog.Title = string.Format(Title, "tv season fanart");
                break;

            case GalleryType.TvSeasonBanner:
                dialog.Title = string.Format(Title, "tv series banner");
                break;

            case GalleryType.TvEpisodeScreenshot:
                dialog.Title = string.Format(Title, "tv episode screenshot");
                break;
            }

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                switch (this.galleryType)
                {
                case GalleryType.MovieFanart:
                    MovieDBFactory.GetCurrentMovie().FanartPathOnDisk = dialog.FileName;
                    MovieDBFactory.InvokeFanartLoaded(new EventArgs());
                    break;

                case GalleryType.MoviePoster:
                    MovieDBFactory.GetCurrentMovie().PosterPathOnDisk = dialog.FileName;
                    MovieDBFactory.InvokePosterLoaded(new EventArgs());
                    break;

                case GalleryType.TvSeriesBanner:
                    TvDBFactory.CurrentSeries.SeriesBannerUrl = dialog.FileName;
                    TvDBFactory.InvokeSeriesBannerLoaded(new EventArgs());
                    break;

                case GalleryType.TvSeriesPoster:
                    TvDBFactory.CurrentSeries.PosterUrl = dialog.FileName;
                    TvDBFactory.InvokeSeriesPosterLoaded(new EventArgs());
                    break;

                case GalleryType.TvSeriesFanart:
                    TvDBFactory.CurrentSeries.FanartUrl = dialog.FileName;
                    TvDBFactory.InvokeSeriesFanartLoaded(new EventArgs());
                    break;

                case GalleryType.TvSeasonBanner:
                    TvDBFactory.CurrentSeason.BannerUrl = dialog.FileName;
                    TvDBFactory.InvokeSeasonBannerLoaded(new EventArgs());
                    break;

                case GalleryType.TvSeasonFanart:
                    TvDBFactory.CurrentSeason.FanartUrl = dialog.FileName;
                    TvDBFactory.InvokeSeasonFanartLoaded(new EventArgs());
                    break;

                case GalleryType.TvSeasonPoster:
                    TvDBFactory.CurrentSeason.PosterUrl = dialog.FileName;
                    TvDBFactory.InvokeSeasonPosterLoaded(new EventArgs());
                    break;

                case GalleryType.TvEpisodeScreenshot:
                    TvDBFactory.CurrentEpisode.EpisodeScreenshotUrl = dialog.FileName;
                    TvDBFactory.InvokeEpisodeLoaded(new EventArgs());
                    break;
                }
            }
        }
示例#30
0
        /// <summary>
        /// The generate movies in set.
        /// </summary>
        private void GenerateMoviesInSet()
        {
            var setList = MovieSetManager.GetSetsContainingMovie(MovieDBFactory.GetCurrentMovie());

            this.txtMovieIsSets.Text = string.Join(Environment.NewLine, setList);
        }