client/src/Iri.Modernisation.Data/Models/VideoBook.cs
author Matthieu Totet
Tue, 05 Jan 2010 15:53:48 +0100
changeset 28 2d4ec5ab2a40
parent 27 f292db96b050
child 30 644e3cd48034
permissions -rw-r--r--
Commit Before SL4

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
namespace Iri.Modernisation.Data.Models
{
    /// <summary>
    /// Classe VideoLivre
    /// </summary>
    public class VideoBook
    {
        /// <summary>
        /// Titre du VideoLivre
        /// </summary>
        public String Title { get; set; }

        /// <summary>
        /// Auteur du VideoLivre
        /// </summary>
        public User Author { get; set; }

        /// <summary>
        /// Chapitre du VideoLivre
        /// </summary>
        public VideoChapter[] Chapters { get; set; }

        /// <summary>
        /// Durée du VideoLivre
        /// </summary>
        public TimeSpan Duration { get; set; }

        /// <summary>
        /// Chemin de la vidéo fini
        /// </summary>
        public String MediaPath { get; set; }

        /// <summary>
        /// Constructeur par défaut
        /// </summary>
        public VideoBook()
        {
            Chapters = new VideoChapter[FactoryVideoLivre.VideoChapterDescriptions.Length];
            for (int nbChapitre = 0; nbChapitre < FactoryVideoLivre.VideoChapterDescriptions.Length; nbChapitre++)
            {
                Chapters[nbChapitre] = new VideoChapter(this,
                                                         FactoryVideoLivre.VideoChapterDescriptions[nbChapitre].Id,
                                                         FactoryVideoLivre.VideoChapterDescriptions[nbChapitre].Title,
                                                         FactoryVideoLivre.VideoChapterDescriptions[nbChapitre].Color);

            }
         
        }

        
    }

    /// <summary>
    /// Comparateur pour Trier les livres
    /// </summary>
    public class VideoBookComparer : IComparer<VideoBook>
    {
        public int Compare(VideoBook x, VideoBook y)
        {
            return x.Title.CompareTo(y.Title);
        }
    }
}