|
0
|
1 |
using System; |
|
|
2 |
using System.Net; |
|
|
3 |
using System.Windows; |
|
|
4 |
using System.Windows.Controls; |
|
|
5 |
using System.Windows.Documents; |
|
|
6 |
using System.Windows.Ink; |
|
|
7 |
using System.Windows.Input; |
|
|
8 |
using System.Windows.Media; |
|
|
9 |
using System.Windows.Media.Animation; |
|
|
10 |
using System.Windows.Shapes; |
|
|
11 |
using System.Collections.Generic; |
|
|
12 |
namespace Iri.Modernisation.Data.Models |
|
|
13 |
{ |
|
|
14 |
/// <summary> |
|
|
15 |
/// Classe VideoLivre |
|
|
16 |
/// </summary> |
|
|
17 |
public class VideoBook |
|
|
18 |
{ |
|
|
19 |
/// <summary> |
|
|
20 |
/// Titre du VideoLivre |
|
|
21 |
/// </summary> |
|
|
22 |
public String Title { get; set; } |
|
|
23 |
|
|
|
24 |
/// <summary> |
|
|
25 |
/// Auteur du VideoLivre |
|
|
26 |
/// </summary> |
|
|
27 |
public User Author { get; set; } |
|
|
28 |
|
|
|
29 |
/// <summary> |
|
|
30 |
/// Chapitre du VideoLivre |
|
|
31 |
/// </summary> |
|
|
32 |
public VideoChapter[] Chapters { get; set; } |
|
|
33 |
|
|
|
34 |
/// <summary> |
|
|
35 |
/// Durée du VideoLivre |
|
|
36 |
/// </summary> |
|
|
37 |
public TimeSpan Duration { get; set; } |
|
|
38 |
|
|
|
39 |
/// <summary> |
|
|
40 |
/// Chemin de la vidéo fini |
|
|
41 |
/// </summary> |
|
|
42 |
public String MediaPath { get; set; } |
|
|
43 |
|
|
|
44 |
/// <summary> |
|
|
45 |
/// Constructeur par défaut |
|
|
46 |
/// </summary> |
|
|
47 |
public VideoBook() |
|
|
48 |
{ |
|
27
|
49 |
Chapters = new VideoChapter[FactoryVideoLivre.VideoChapterDescriptions.Length]; |
|
|
50 |
for (int nbChapitre = 0; nbChapitre < FactoryVideoLivre.VideoChapterDescriptions.Length; nbChapitre++) |
|
|
51 |
{ |
|
|
52 |
Chapters[nbChapitre] = new VideoChapter(this, |
|
|
53 |
FactoryVideoLivre.VideoChapterDescriptions[nbChapitre].Id, |
|
|
54 |
FactoryVideoLivre.VideoChapterDescriptions[nbChapitre].Title, |
|
|
55 |
FactoryVideoLivre.VideoChapterDescriptions[nbChapitre].Color); |
|
|
56 |
|
|
|
57 |
} |
|
0
|
58 |
|
|
|
59 |
} |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
} |
|
|
63 |
|
|
|
64 |
/// <summary> |
|
|
65 |
/// Comparateur pour Trier les livres |
|
|
66 |
/// </summary> |
|
|
67 |
public class VideoBookComparer : IComparer<VideoBook> |
|
|
68 |
{ |
|
|
69 |
public int Compare(VideoBook x, VideoBook y) |
|
|
70 |
{ |
|
|
71 |
return x.Title.CompareTo(y.Title); |
|
|
72 |
} |
|
|
73 |
} |
|
|
74 |
} |