Beispiel #1
0
        internal static StackPanel getVistaSeleccionarSerie(MainWindow mainWindow, Serie item)
        {
            StackPanel tmpPanel = new StackPanel();

            tmpPanel.Style = (Style)Application.Current.Resources["StackPanelSeleccionarSerie"];


            Label tmpLabelTitulo = new Label();

            tmpLabelTitulo.Content = item.titulo;
            tmpLabelTitulo.Style   = (Style)Application.Current.Resources["LabelListaSeries"];
            tmpPanel.Children.Add(tmpLabelTitulo);


            Button tmpButton = new Button();

            tmpButton.Click += delegate
            {
                mainWindow.serieSeleccionada = item;
                mainWindow.serieSeleccionada.getPatrones(mainWindow.config);
                UpdateIU.Update(mainWindow, Codigos.ADD_PATRON_SERIE_SELEC);
            };
            tmpButton.Style   = (Style)Application.Current.Resources["Button"];
            tmpButton.Content = "Seleccionar";
            tmpPanel.Children.Add(tmpButton);

            return(tmpPanel);
        }
        public MainWindow()
        {
            InitializeComponent();
            UpdateIU.Update(this, Codigos.ESTADO_INICIAL);

            config      = configXML.leerConfig();
            LogErrorXML = new LoggerXML(config.errorLog);
            LogMediaXML = new LoggerXML(config.mediaLog);
            LogMediaXML = new LoggerXML(config.datosLog);
            SeriesXML   = new SeriesXML(config);
            PatronesXML = new PatronesXML(config);


            ErroresContinuidad = new List <string>();
            ErroresHomogenia   = new List <string>();
            ErroresDuplicidad  = new List <FileSystemInfo[]>();



            //series = SeriesXML.leerSeries();
            //foreach (Serie item in series)
            //{
            //    item.titDescarga = item.titulo.Replace(' ', '_');
            //    SeriesXML.updateSerie(item);
            //}
        }
        private void ButtonAñadirSerie_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string[] extensiones = { ".mkv", ".avi", ".mp4" };
                if (Validar.validarAddSerie(this))
                {
                    SeriesXML.añadirSerie(new Serie
                    {
                        titulo = textBoxTitulo.Text.Trim(),
                        capitulosPorTemporada = Convert.ToInt32(textBoxCapitulosTemporada.Text.Trim()),
                        estado           = "A",
                        extension        = extensiones[comboBoxExtensionSerie.SelectedIndex],
                        numeroTemporadas = Convert.ToInt32(textBoxNumeroTemporadas.Text.Trim()),
                        temporadaActual  = 1
                    });

                    MessageBox.Show("Serie añadida correctamente");
                    UpdateIU.Update(this, Codigos.ADD_SERIE_OK);

                    updateListaSeries();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Datos insertados incorrectos");
            }
        }
        private void RenombrarVideos_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            UpdateIU.Update(this, Codigos.LIMPIAR_ANTIGUOS_RESULTADOS_RENOMBRAR);
            ProgressBar pb = new ProgressBar();

            GestorVideos.renombrarVideos(this);
            UpdateIU.Update(this, Codigos.MOSTRAR_RESULTADOS_RENOMBRAR);
        }
Beispiel #5
0
        internal static UIElement getVistaDuplicidad(MainWindow mainWindow, FileSystemInfo[] item)
        {
            Border border = new Border();

            border.Style = (Style)Application.Current.Resources["Border"];

            StackPanel tmpPanel = new StackPanel();

            //titulo
            Label tmpLabel1 = new Label();

            tmpLabel1.Content             = item[0].Name;
            tmpLabel1.Style               = (Style)Application.Current.Resources["LabelListaSeries"];
            tmpLabel1.HorizontalAlignment = HorizontalAlignment.Center;
            tmpPanel.Children.Add(tmpLabel1);

            //titulo
            Label tmpLabel2 = new Label();

            tmpLabel2.Content             = item[1].Name;
            tmpLabel2.Style               = (Style)Application.Current.Resources["LabelListaSeries"];
            tmpLabel2.HorizontalAlignment = HorizontalAlignment.Center;
            tmpPanel.Children.Add(tmpLabel2);


            Button tmpButton = new Button();

            tmpButton.Width  = 60;
            tmpButton.Click += delegate
            {
                try
                {
                    if (MessageBox.Show("¿Seguro que quieres borrar el fichero?", "Borrar", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                    {
                        File.SetAttributes(item[1].FullName, FileAttributes.Normal);
                        item[1].Delete();
                        mainWindow.ErroresDuplicidad.Remove(item);
                    }
                    UpdateIU.Update(mainWindow, Codigos.VER_DUPLICIDAD);
                }
                catch (Exception e)
                {
                    MessageBox.Show("Error borrando el fichero" + e);
                }
            };
            tmpButton.Style   = (Style)Application.Current.Resources["Button"];
            tmpButton.Content = "Borrar";
            tmpPanel.Children.Add(tmpButton);

            border.Child = tmpPanel;
            return(border);
        }
 private void ButtonAddPatron_Click(object sender, RoutedEventArgs e)
 {
     if (Validar.validarAddPatron(this))
     {
         PatronesXML.añadirPatron(new Patron {
             nombreSerie = serieSeleccionada.titulo, textoPatron = textBoxNuevoPatron.Text.Trim()
         });
         serieSeleccionada.getPatrones(config);
         UpdateIU.Update(this, Codigos.ADD_PATRON_OK);
     }
     else
     {
         MessageBox.Show("Patron invalido");
     }
 }
Beispiel #7
0
        internal static StackPanel getVistaSerieInactiva(MainWindow mainWindow, Serie serie)
        {
            StackPanel tmpPanel = new StackPanel();

            tmpPanel.Style = (Style)Application.Current.Resources["StackPanelSeleccionarSerie"];

            //bitmap
            BitmapImage src = new BitmapImage();

            src.BeginInit();
            src.UriSource = new Uri("Iconos/powerOn.png", UriKind.Relative);
            src.EndInit();

            //titulo
            Label tmpLabelTitulo = new Label();

            tmpLabelTitulo.Content             = serie.titulo;
            tmpLabelTitulo.Style               = (Style)Application.Current.Resources["LabelListaSeries"];
            tmpLabelTitulo.HorizontalAlignment = HorizontalAlignment.Center;
            tmpPanel.Children.Add(tmpLabelTitulo);


            //imagen max
            Image tmpImagenMax = new Image();

            tmpImagenMax.Source             = src;
            tmpImagenMax.Style              = (Style)Application.Current.Resources["Image"];
            tmpImagenMax.MouseLeftButtonUp += delegate
            {
                serie.estado = "A";
                mainWindow.SeriesXML.updateSerie(serie);
                UpdateIU.Update(mainWindow, Codigos.PANEL_IO_SERIES);
            };
            tmpPanel.Children.Add(tmpImagenMax);

            return(tmpPanel);
        }
 private void ImageIncTemp_MouseLeftButtonUp_1(object sender, MouseButtonEventArgs e)
 {
     updateListaSeries();
     UpdateIU.Update(this, Codigos.PANEL_INCREMENTAR_TEMPORADAS);
 }
 /// <summary>
 /// Handles the MouseLeftButtonUp event of the OrdenarVideos control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
 private void OrdenarVideos_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     UpdateIU.Update(this, Codigos.PANEL_ORDENAR_VIDEOS);
 }
Beispiel #10
0
 private void RecogerVideos_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     UpdateIU.Update(this, Codigos.LIMPIAR_ANTIGUOS_RESULTADOS_RECOGER);
     GestorVideos.recogerTorrent(this);
     UpdateIU.Update(this, Codigos.MOSTRAR_RESULTADOS_RECOGER);
 }
Beispiel #11
0
 private void ImageDescarga_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     UpdateIU.Update(this, Codigos.PANEL_DESCARGA);
 }
Beispiel #12
0
        internal static StackPanel getVistaIncrementarTemporadas(MainWindow mainWindow, Serie serie)
        {
            StackPanel tmpPanel = new StackPanel();

            tmpPanel.Style = (Style)Application.Current.Resources["StackPanelSeleccionarSerie"];

            //bitmap
            BitmapImage srcMin = new BitmapImage();

            srcMin.BeginInit();
            srcMin.UriSource = new Uri("Iconos/sub.png", UriKind.Relative);
            srcMin.EndInit();


            //bitmap
            BitmapImage srcMax = new BitmapImage();

            srcMax.BeginInit();
            srcMax.UriSource = new Uri("Iconos/suma.png", UriKind.Relative);
            srcMax.EndInit();

            ////añado imagen min
            Image tmpImagenSubMin = new Image();

            tmpImagenSubMin.Source             = srcMin;
            tmpImagenSubMin.Style              = (Style)Application.Current.Resources["Image"];
            tmpImagenSubMin.MouseLeftButtonUp += delegate
            {
                if (serie.temporadaActual > 1)
                {
                    serie.temporadaActual--;
                }
                mainWindow.SeriesXML.updateSerie(serie);
                UpdateIU.Update(mainWindow, Codigos.PANEL_INCREMENTAR_TEMPORADAS);
            };
            tmpPanel.Children.Add(tmpImagenSubMin);

            //añado imagen min
            Image tmpImagenAddMin = new Image();

            tmpImagenAddMin.Source             = srcMax;
            tmpImagenAddMin.Style              = (Style)Application.Current.Resources["Image"];
            tmpImagenAddMin.MouseLeftButtonUp += delegate
            {
                if (serie.temporadaActual < serie.numeroTemporadas)
                {
                    serie.temporadaActual++;
                }
                mainWindow.SeriesXML.updateSerie(serie);
                UpdateIU.Update(mainWindow, Codigos.PANEL_INCREMENTAR_TEMPORADAS);
            };
            tmpPanel.Children.Add(tmpImagenAddMin);

            //temporada min
            Label tmpLabelTemporadaMin = new Label();

            tmpLabelTemporadaMin.Content = serie.temporadaActual;
            tmpLabelTemporadaMin.Style   = (Style)Application.Current.Resources["LabelListaSeries"];
            tmpLabelTemporadaMin.Width   = 30;
            tmpPanel.Children.Add(tmpLabelTemporadaMin);

            //titulo
            Label tmpLabelTitulo = new Label();

            tmpLabelTitulo.Content = serie.titulo;
            tmpLabelTitulo.Style   = (Style)Application.Current.Resources["LabelListaSeries"];
            tmpPanel.Children.Add(tmpLabelTitulo);

            //temporada max
            Label tmpLabelTemporadaMax = new Label();

            tmpLabelTemporadaMax.Content = serie.numeroTemporadas;
            tmpLabelTemporadaMax.Style   = (Style)Application.Current.Resources["LabelListaSeries"];
            tmpLabelTemporadaMax.Width   = 30;
            tmpPanel.Children.Add(tmpLabelTemporadaMax);

            //imagen max
            Image tmpImagenSubMax = new Image();

            tmpImagenSubMax.Source             = srcMin;
            tmpImagenSubMax.Style              = (Style)Application.Current.Resources["Image"];
            tmpImagenSubMax.MouseLeftButtonUp += delegate
            {
                if (serie.numeroTemporadas > serie.temporadaActual)
                {
                    serie.numeroTemporadas--;
                }
                mainWindow.SeriesXML.updateSerie(serie);
                UpdateIU.Update(mainWindow, Codigos.PANEL_INCREMENTAR_TEMPORADAS);
            };
            tmpPanel.Children.Add(tmpImagenSubMax);

            //imagen max
            Image tmpImagenAddMax = new Image();

            tmpImagenAddMax.Source             = srcMax;
            tmpImagenAddMax.Style              = (Style)Application.Current.Resources["Image"];
            tmpImagenAddMax.MouseLeftButtonUp += delegate
            {
                serie.numeroTemporadas++;
                mainWindow.SeriesXML.updateSerie(serie);
                UpdateIU.Update(mainWindow, Codigos.PANEL_INCREMENTAR_TEMPORADAS);
            };
            tmpPanel.Children.Add(tmpImagenAddMax);

            return(tmpPanel);
        }
Beispiel #13
0
 private void ButtonVerHomogenia_Click(object sender, RoutedEventArgs e)
 {
     UpdateIU.Update(this, Codigos.VER_HOMOGENIA);
 }
Beispiel #14
0
 private void ButtonVerDuplicidad_Click(object sender, RoutedEventArgs e)
 {
     UpdateIU.Update(this, Codigos.VER_DUPLICIDAD);
 }
Beispiel #15
0
 private void StartMantenimiento_LeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     GestorVideos.Mantenimiento(this);
     UpdateIU.Update(this, Codigos.RESULTADO_MANTENIMIENTO);
 }
Beispiel #16
0
 private void ButtonVerContinuidad_Click(object sender, RoutedEventArgs e)
 {
     UpdateIU.Update(this, Codigos.VER_CONTINUIDAD);
 }
Beispiel #17
0
 private void ImageMantenimiento_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     UpdateIU.Update(this, Codigos.PANEL_MANTENIMIENTO);
 }
Beispiel #18
0
 private void AddDatos_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     UpdateIU.Update(this, Codigos.PANEL_ADD_DATOS);
 }
Beispiel #19
0
 private void ImageIOSerie_MouseLeftButtonUp_1(object sender, MouseButtonEventArgs e)
 {
     updateListaSeries();
     UpdateIU.Update(this, Codigos.PANEL_IO_SERIES);
 }
Beispiel #20
0
 private void ImageAddSerie_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     UpdateIU.Update(this, Codigos.ADD_SERIE);
 }
Beispiel #21
0
 private void ImageAddPatron_MouseLeftButtonUp_1(object sender, MouseButtonEventArgs e)
 {
     UpdateIU.Update(this, Codigos.ADD_PATRON);
 }