|
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 |
{ |
|
|
15 |
/// <summary> |
|
|
16 |
/// |
|
|
17 |
/// </summary> |
|
|
18 |
public static class SettingsProject |
|
|
19 |
{ |
|
35
|
20 |
|
|
|
21 |
|
|
30
|
22 |
static public List<VideoBook> ListVideoBook { get; set; } |
|
|
23 |
|
|
|
24 |
static SettingsProject() |
|
|
25 |
{ |
|
35
|
26 |
//_internalDictionary.Add(new Loader<List<VideoBook>>(VideoBook.GetListVideoBook), |
|
|
27 |
// new KeyValuePair<string, object>("", null)); |
|
30
|
28 |
} |
|
|
29 |
/// <summary> |
|
|
30 |
/// (Télé)Chargement des données; |
|
|
31 |
/// </summary> |
|
|
32 |
/// <param name="configFileURI"></param> |
|
|
33 |
static public void Load(String configFileURI) |
|
|
34 |
{ |
|
|
35 |
FactoryVideoLivre.Initialize(); |
|
|
36 |
FactoryVideoLivre.FactoryReady += new EventHandler(FactoryVideoLivre_FactoryReady); |
|
|
37 |
FactoryVideoLivre.LoadXMLFile(configFileURI); |
|
35
|
38 |
|
|
30
|
39 |
} |
|
|
40 |
|
|
|
41 |
/// <summary> |
|
|
42 |
/// |
|
|
43 |
/// </summary> |
|
|
44 |
/// <param name="sender"></param> |
|
|
45 |
/// <param name="e"></param> |
|
|
46 |
static void FactoryVideoLivre_FactoryReady(object sender, EventArgs e) |
|
|
47 |
{ |
|
35
|
48 |
|
|
|
49 |
Loader<List<VideoBook>> loaderListVideoBook = new Loader<List<VideoBook>>(VideoBook.GetListVideoBook); |
|
|
50 |
loaderListVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<List<VideoBook>>>(LoaderVideoBook_LoaderFinished); |
|
|
51 |
loaderListVideoBook.Load(FactoryVideoLivre.VideoBookListPath); |
|
|
52 |
// VideoBookLoaderHelper LoaderVideoBook = new VideoBookLoaderHelper(FactoryVideoLivre.VideoBookListPath); |
|
|
53 |
// LoaderVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<List<VideoBook>>>(LoaderVideoBook_LoaderFinished); |
|
|
54 |
|
|
30
|
55 |
} |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
static void LoaderVideoBook_LoaderFinished(object sender, LoaderEventArgs<List<VideoBook>> e) |
|
|
60 |
{ |
|
|
61 |
SettingsProject.ListVideoBook = e.CreatedObject; |
|
|
62 |
if (SettingsLoaded != null) |
|
|
63 |
SettingsLoaded(sender, e); |
|
|
64 |
} |
|
|
65 |
/// <summary> |
|
|
66 |
/// Evenement prévenant quand tout est pret |
|
|
67 |
/// </summary> |
|
|
68 |
static public event EventHandler SettingsLoaded; |
|
|
69 |
} |
|
|
70 |
} |