|
30
|
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 |
using System.Threading; |
|
|
13 |
namespace Iri.Modernisation.Data.Models |
|
|
14 |
{ |
|
36
|
15 |
|
|
|
16 |
|
|
30
|
17 |
/// <summary> |
|
|
18 |
/// |
|
|
19 |
/// </summary> |
|
|
20 |
public static class SettingsProject |
|
|
21 |
{ |
|
35
|
22 |
|
|
|
23 |
|
|
36
|
24 |
|
|
|
25 |
|
|
30
|
26 |
static public List<VideoBook> ListVideoBook { get; set; } |
|
36
|
27 |
static public List<VideoSequence> ProductionVideo { get; set; } |
|
|
28 |
static public Sync Synchronizer { get; set; } |
|
30
|
29 |
static SettingsProject() |
|
|
30 |
{ |
|
36
|
31 |
Synchronizer = new Sync(); |
|
|
32 |
Synchronizer.Completed += new EventHandler<EventArgs>(Synchronizer_Completed); |
|
|
33 |
} |
|
|
34 |
|
|
|
35 |
static void Synchronizer_Completed(object sender, EventArgs e) |
|
|
36 |
{ |
|
|
37 |
if (SettingsLoaded != null) |
|
|
38 |
SettingsLoaded(sender, e); |
|
30
|
39 |
} |
|
|
40 |
/// <summary> |
|
|
41 |
/// (Télé)Chargement des données; |
|
|
42 |
/// </summary> |
|
|
43 |
/// <param name="configFileURI"></param> |
|
|
44 |
static public void Load(String configFileURI) |
|
|
45 |
{ |
|
|
46 |
FactoryVideoLivre.Initialize(); |
|
|
47 |
FactoryVideoLivre.FactoryReady += new EventHandler(FactoryVideoLivre_FactoryReady); |
|
|
48 |
FactoryVideoLivre.LoadXMLFile(configFileURI); |
|
35
|
49 |
|
|
30
|
50 |
} |
|
|
51 |
|
|
|
52 |
/// <summary> |
|
36
|
53 |
/// Une fois que le fichier config du projet est chargé |
|
30
|
54 |
/// </summary> |
|
|
55 |
/// <param name="sender"></param> |
|
|
56 |
/// <param name="e"></param> |
|
|
57 |
static void FactoryVideoLivre_FactoryReady(object sender, EventArgs e) |
|
|
58 |
{ |
|
35
|
59 |
|
|
|
60 |
Loader<List<VideoBook>> loaderListVideoBook = new Loader<List<VideoBook>>(VideoBook.GetListVideoBook); |
|
36
|
61 |
|
|
|
62 |
loaderListVideoBook.LoaderFinished += new EventHandler<EventArgs>(LoaderVideoBook_LoaderFinished); |
|
|
63 |
Synchronizer.RegisterLoader(loaderListVideoBook); |
|
|
64 |
|
|
|
65 |
|
|
|
66 |
Loader<List<VideoSequence>> loaderProductionVideo = new Loader<List<VideoSequence>>(VideoSequence.GetProductionVideo); |
|
35
|
67 |
|
|
36
|
68 |
loaderProductionVideo.LoaderFinished += new EventHandler<EventArgs>(loaderProductionVideo_LoaderFinished); |
|
|
69 |
Synchronizer.RegisterLoader(loaderProductionVideo); |
|
|
70 |
|
|
|
71 |
loaderProductionVideo.Load(FactoryVideoLivre.ProductionVideoPath); |
|
|
72 |
loaderListVideoBook.Load(FactoryVideoLivre.VideoBookListPath); |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
} |
|
|
76 |
|
|
|
77 |
static void loaderProductionVideo_LoaderFinished(object sender, EventArgs e) |
|
|
78 |
{ |
|
|
79 |
SettingsProject.ProductionVideo = ((LoaderEventArgs<List<VideoSequence>>)e).CreatedObject; |
|
|
80 |
|
|
30
|
81 |
} |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
36
|
85 |
static void LoaderVideoBook_LoaderFinished(object sender, EventArgs e) |
|
30
|
86 |
{ |
|
36
|
87 |
SettingsProject.ListVideoBook = ((LoaderEventArgs<List<VideoBook>>)e).CreatedObject; |
|
|
88 |
|
|
30
|
89 |
} |
|
|
90 |
/// <summary> |
|
|
91 |
/// Evenement prévenant quand tout est pret |
|
|
92 |
/// </summary> |
|
|
93 |
static public event EventHandler SettingsLoaded; |
|
|
94 |
} |
|
|
95 |
} |