client/src/Iri.Modernisation.Data/Models/SettingsProject.cs
author totetm <>
Mon, 25 Jan 2010 09:30:22 +0100
changeset 35 43bb1b8ed555
parent 32 36302cc9688d
child 36 b6df6fce6e5d
permissions -rw-r--r--
IRIFiles Class Web Loader and Sender
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     1
using System;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     2
using System.Net;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     3
using System.Windows;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     4
using System.Windows.Controls;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     5
using System.Windows.Documents;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     6
using System.Windows.Ink;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     7
using System.Windows.Input;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     8
using System.Windows.Media;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
     9
using System.Windows.Media.Animation;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    10
using System.Windows.Shapes;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    11
using System.Collections.Generic;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    12
using System.Threading;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    13
namespace Iri.Modernisation.Data.Models
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    14
{
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    15
    /// <summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    16
    /// 
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    17
    /// </summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    18
    public static class SettingsProject
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    19
    {
35
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    20
        
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    21
        
30
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    22
        static public List<VideoBook> ListVideoBook { get; set; }
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    23
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    24
        static SettingsProject()
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    25
        {
35
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    26
            //_internalDictionary.Add(new Loader<List<VideoBook>>(VideoBook.GetListVideoBook), 
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    27
           //     new KeyValuePair<string, object>("", null));
30
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    28
        }
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    29
        /// <summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    30
        /// (Télé)Chargement des données;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    31
        /// </summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    32
        /// <param name="configFileURI"></param>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    33
        static public void Load(String configFileURI)
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    34
        {
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    35
            FactoryVideoLivre.Initialize();
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    36
            FactoryVideoLivre.FactoryReady += new EventHandler(FactoryVideoLivre_FactoryReady);
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    37
            FactoryVideoLivre.LoadXMLFile(configFileURI);
35
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    38
            
30
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    39
        }
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    40
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    41
        /// <summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    42
        /// 
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    43
        /// </summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    44
        /// <param name="sender"></param>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    45
        /// <param name="e"></param>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    46
        static void FactoryVideoLivre_FactoryReady(object sender, EventArgs e)
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    47
        {
35
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    48
            
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    49
            Loader<List<VideoBook>> loaderListVideoBook = new Loader<List<VideoBook>>(VideoBook.GetListVideoBook);
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    50
            loaderListVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<List<VideoBook>>>(LoaderVideoBook_LoaderFinished);
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    51
            loaderListVideoBook.Load(FactoryVideoLivre.VideoBookListPath); 
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    52
           // VideoBookLoaderHelper LoaderVideoBook = new VideoBookLoaderHelper(FactoryVideoLivre.VideoBookListPath);
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    53
           // LoaderVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<List<VideoBook>>>(LoaderVideoBook_LoaderFinished);
43bb1b8ed555 IRIFiles Class
totetm <>
parents: 32
diff changeset
    54
          
30
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    55
        }
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    56
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    57
       
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    58
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    59
        static void LoaderVideoBook_LoaderFinished(object sender, LoaderEventArgs<List<VideoBook>> e)
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    60
        {
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    61
            SettingsProject.ListVideoBook = e.CreatedObject;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    62
            if (SettingsLoaded != null)
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    63
                SettingsLoaded(sender, e);
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    64
        }
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    65
        /// <summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    66
        /// Evenement prévenant quand tout est pret
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    67
        /// </summary>
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    68
        static public event EventHandler SettingsLoaded;
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    69
    }
644e3cd48034 Introduce in Web context
totetm <>
parents:
diff changeset
    70
}