--- a/client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs Mon Jan 25 09:30:22 2010 +0100
@@ -293,62 +293,13 @@
{
static HeaderProduction()
{
- Chap01EditingOkClick = new Command("Chap01EditingOkClick");
- Chap01IndexingOkClick = new Command("Chap01IndexingOkClick");
-
- Chap02EditingOkClick = new Command("Chap02EditingOkClick");
- Chap02IndexingOkClick = new Command("Chap02IndexingOkClick");
-
- Chap03EditingOkClick = new Command("Chap03EditingOkClick");
- Chap03IndexingOkClick = new Command("Chap03IndexingOkClick");
-
- Chap04EditingOkClick = new Command("Chap04EditingOkClick");
- Chap04IndexingOkClick = new Command("Chap04IndexingOkClick");
+
PublishClick = new Command("PublishClick");
SaveClick = new Command("SaveClick");
}
- public static Command Chap01EditingOkClick
- {
- get;
- private set;
- }
- public static Command Chap01IndexingOkClick
- {
- get;
- private set;
- }
- public static Command Chap02EditingOkClick
- {
- get;
- private set;
- }
- public static Command Chap02IndexingOkClick
- {
- get;
- private set;
- }
- public static Command Chap03EditingOkClick
- {
- get;
- private set;
- }
- public static Command Chap03IndexingOkClick
- {
- get;
- private set;
- }
- public static Command Chap04EditingOkClick
- {
- get;
- private set;
- }
- public static Command Chap04IndexingOkClick
- {
- get;
- private set;
- }
+
public static Command PublishClick
{
get;
@@ -460,11 +411,17 @@
FlipView = new Command("FlipView");
GoToTime = new Command("GoToTime");
ActivePart = new Command("ActivePart");
-
+ EscapeKeyPressed = new Command("EscapeKeyPressed");
// VideoPositionTimer.Tick += new EventHandler(Each_Tick);
}
+ public static Command EscapeKeyPressed
+ {
+ get;
+ private set;
+ }
+
public static Command ActivePart
{
get;
--- a/client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj Mon Jan 25 09:30:22 2010 +0100
@@ -88,6 +88,7 @@
<Reference Include="System.Xml" />
<Reference Include="System.Net" />
<Reference Include="System.Windows.Browser" />
+ <Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\BoolToVisibility.cs" />
--- a/client/src/Iri.Modernisation.Controls/View/ContextualBinderLayer/ContextualBinderLayer.xaml.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/ContextualBinderLayer/ContextualBinderLayer.xaml.cs Mon Jan 25 09:30:22 2010 +0100
@@ -27,6 +27,8 @@
InitializeComponent();
Commands.PolemicElement.ElementSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ElementSelected_Executed);
Commands.ContextualBinderLayer.EndBind.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EndBind_Executed);
+ Commands.EscapeKeyPressed.Executed += Commands.ContextualBinderLayer.EndBind.Execute;
+
MouseLeftButtonUp += new MouseButtonEventHandler(ContextualBinderLayer_MouseLeftButtonUp);
MouseMove += new MouseEventHandler(ContextualBinderLayer_MouseMove);
Commands.ContextualBinderLayer.BeginBind.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(BeginBind_Executed);
--- a/client/src/Iri.Modernisation.Controls/View/Main/Main.xaml Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/Main/Main.xaml Mon Jan 25 09:30:22 2010 +0100
@@ -6,8 +6,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" x:Class="Iri.Modernisation.Controls.View.Main"
d:DesignHeight="480"
- xmlns:hsl="clr-namespace:HackingSilverlightLibrary;assembly=HackingSilverlightLibrary"
+ xmlns:hsl="clr-namespace:HackingSilverlightLibrary;assembly=HackingSilverlightLibrary" KeyDown="UserControl_KeyDown"
>
+
<Grid x:Name="LayoutRoot" Background="Black" >
<View:NavigationBar x:Name="NavigationBarElement" DataContext="{Binding ViewModelNavigationBar}" HorizontalAlignment="Left" d:LayoutOverrides="Width, Height" VerticalAlignment="Top" Grid.RowSpan="2" Margin="5,5,0,0"/>
--- a/client/src/Iri.Modernisation.Controls/View/Main/Main.xaml.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/Main/Main.xaml.cs Mon Jan 25 09:30:22 2010 +0100
@@ -26,5 +26,13 @@
Commands.VideoViewer.Pause.Execute();
FlipTest.ExecuteFlip();
}
+
+ private void UserControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+ {
+ if(e.Key == Key.Escape)
+ {
+ Commands.EscapeKeyPressed.Execute();
+ }
+ }
}
}
--- a/client/src/Iri.Modernisation.Controls/View/ProductionEditor/ProductionEditor.xaml Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/ProductionEditor/ProductionEditor.xaml Mon Jan 25 09:30:22 2010 +0100
@@ -14,7 +14,7 @@
<ToggleButton IsChecked="{Binding IsRecordMode, Mode=TwoWay}" x:Name="ProductionViewerDisplayWebcamButton" Width="75" Content="Webcam"/>
</StackPanel>
- <View:WebCamControl Visibility="{Binding IsRecordMode, Converter={StaticResource BoolToVisibility}}"/>
+ <View:WebCamControl Visibility="{Binding IsRecordMode, Converter={StaticResource BoolToVisibility}}"/>
<View:VideoViewer x:Name="VideoViewerElement" DataContext="{Binding ViewModelVideoViewer}" Margin="0" Height="227" Width="Auto" d:LayoutOverrides="Height, VerticalMargin"/>
<StackPanel x:Name="DescriptionSegmentPanel" Height="128">
<TextBox IsEnabled="{Binding IsEditableIndex}" x:Name="TitleSegmentLabel" Text="{Binding SelectedIndexTitle, Mode=TwoWay}" TextWrapping="Wrap" Height="24" Margin="0,0,8,0"/>
--- a/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/CustomableIndexElement.xaml.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/CustomableIndexElement.xaml.cs Mon Jan 25 09:30:22 2010 +0100
@@ -15,9 +15,6 @@
public partial class CustomableIndexElement : UserControl
{
-
-
-
public double TrimRight
{
get { return (double)GetValue(TrimRightProperty); }
--- a/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml Mon Jan 25 09:30:22 2010 +0100
@@ -21,7 +21,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
- <Slider x:Name="TimeSlider" Value="{Binding Position,Mode=TwoWay}" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" SmallChange="0" />
+ <Slider x:Name="TimeSlider" Value="{Binding Position,Mode=TwoWay}" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" SmallChange="0" />
<StackPanel x:Name="VideoTimeStrip" Margin="0,21,0,0" Orientation="Horizontal" Height="32" VerticalAlignment="Top" HorizontalAlignment="Left">
<!--<StackPanel Orientation="Horizontal" x:Name="ModenisationVideoTimeStrip"></StackPanel>
<StackPanel Orientation="Horizontal" x:Name="ModeniteVideoTimeStrip"></StackPanel>
--- a/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs Mon Jan 25 09:30:22 2010 +0100
@@ -22,6 +22,7 @@
get;
set;
}
+
public ProductionTimeLine()
{
ScaleTime = 0.0002;
@@ -30,12 +31,28 @@
Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed);
Commands.ProductionView.VideoRecordUpdated.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(VideoRecordUpdated_Executed);
TimeSlider.MouseLeftButtonUp += new MouseButtonEventHandler(TimeSlider_MouseLeftButtonUp);
- //TimeSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(TimeSlider_ValueChanged);
+ TimeSlider.MouseMove += new MouseEventHandler(TimeSlider_MouseMove);
+ TimeSlider.MouseLeftButtonDown += new MouseButtonEventHandler(TimeSlider_MouseLeftButtonDown);
+ TimeSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(TimeSlider_ValueChanged);
TimeSlider.Maximum = TimeSlider.ActualWidth / ProductionTimeLine.ScaleTime;
ScaleTimeLine.ValueChanged += new RoutedPropertyChangedEventHandler<double>(ScaleTimeLine_ValueChanged);
}
+ bool _mousecapture { get; set; }
+ void TimeSlider_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ _mousecapture = true;
+ }
+
+
+ void TimeSlider_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (_mousecapture)
+ ((ProductionTimeLineVM)DataContext).ViewModelVideoViewer.Pause();
+ }
+
+
void ScaleTimeLine_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
ScaleTime = e.NewValue / 3200000;
@@ -45,12 +62,16 @@
void TimeSlider_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
+
Commands.TimeChange.Execute(TimeSlider.Value,DataContext);
+ ReleaseMouseCapture();
+ _mousecapture = false;
}
void TimeSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
- DeleteSequenceButton.Content = TimeSpan.FromMilliseconds(TimeSlider.Value);
+
+
}
@@ -124,6 +145,7 @@
//an.DataContext = new PolemicElementVM(Si);
an.MouseLeftButtonDown += new MouseButtonEventHandler(an_MouseLeftButtonDown);
+
an.MouseMove += new MouseEventHandler(an_MouseMove);
an.MouseLeftButtonUp += new MouseButtonEventHandler(an_MouseLeftButtonUp);
//((ProductionTimeLineVM)DataContext).SelectedBookChapter);
@@ -261,5 +283,7 @@
//VideoTimeStrip.Children.Remove(_selected);
Commands.ProductionView.DelVideoSequence.Execute(((CustomableVideoElement)_selected).DataContext);
}
+
+
}
}
\ No newline at end of file
--- a/client/src/Iri.Modernisation.Controls/View/ProductionView/ProductionView.xaml Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/ProductionView/ProductionView.xaml Mon Jan 25 09:30:22 2010 +0100
@@ -14,8 +14,8 @@
<View:HeaderProduction DataContext="{Binding ViewModelHeaderProduction}" x:Name="HeaderProductionElement" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment"/>
<View:ProductionTimeLine x:Name="ProductionTimeLineElement" Height="176" VerticalAlignment="Bottom" DataContext="{Binding ViewModelProductionTimeLine}"/>
- <View:ProductionEditor DataContext="{Binding ViewModelProductionEditor}" Margin="260,127,457,180" Height="381" Width="245" d:LayoutOverrides="HorizontalAlignment"/>
- <View:VideoViewer DataContext="{Binding ViewModelMasterVideoViewer}" Margin="561,144,20,201" Height="343"/>
+ <View:ProductionEditor DataContext="{Binding ViewModelProductionEditor}" Margin="260,127,409,180" Height="381" d:LayoutOverrides="HorizontalAlignment"/>
+ <View:VideoViewer DataContext="{Binding ViewModelMasterVideoViewer}" Margin="0,144,20,201" Height="343" HorizontalAlignment="Right" Width="385"/>
<StackPanel x:Name="RecordsPanel" HorizontalAlignment="Left" Margin="8,288,0,192" Width="248">
<TextBlock Style="{StaticResource CommonTextBlock}" Text="{Binding RecordsLabel, Source={StaticResource LangLabels}}" x:Name="RecordLabel" TextWrapping="Wrap"/>
<ListBox SelectedItem="{Binding SelectedVideoSequence,Mode=TwoWay}" x:Name="RecordsList" ItemsSource="{Binding RecordedVideoSequences}" Height="152">
--- a/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs Mon Jan 25 09:30:22 2010 +0100
@@ -44,16 +44,19 @@
InitializeComponent(); /// <summary>
VideoScreen.MediaEnded += new RoutedEventHandler(VideoScreen_MediaEnded);
VideoScreen.MediaOpened += new RoutedEventHandler(VideoScreen_MediaOpened);
- VideoPositionTimer.Interval = new System.TimeSpan(0, 0, 0, 0, 1000);
+ VideoPositionTimer.Interval = new System.TimeSpan(0, 0, 0, 0, 500);
VideoPositionTimer.Tick += new EventHandler(VideoPositionTimer_Tick);
Commands.GoToTime.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(GoToTime_Executed);
Commands.VideoViewer.Pause.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(Pause_Executed);
Commands.VideoViewer.Play.Executed +=new EventHandler<SLExtensions.Input.ExecutedEventArgs>(Play_Executed);
+
+
}
void VideoScreen_MediaOpened(object sender, RoutedEventArgs e)
{
+
//VideoScreen.Play();
//VideoPositionTimer.Start();
@@ -68,8 +71,8 @@
{
if (e.Source == DataContext && e.Source != null)
{
- if(!VideoPositionTimer.IsEnabled)
- VideoPositionTimer.Start();
+ //if(!VideoPositionTimer.IsEnabled)
+ //VideoPositionTimer.Start();
VideoScreen.Position = ((TimeSpan)e.Parameter);
--- a/client/src/Iri.Modernisation.Controls/View/WebCamControl/WebCamControl.xaml Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/WebCamControl/WebCamControl.xaml Mon Jan 25 09:30:22 2010 +0100
@@ -15,6 +15,10 @@
<Button x:Name="VideoControlStop" Input:CommandService.Command="CamRecordEnd" Width="43" Content="[]" />
<Button x:Name="VideoControlClose" Input:CommandService.Command="CamRecordStop" Width="25" Content="X"/>
</StackPanel>
- <Rectangle x:Name="VideoScreen" Fill="White" Margin="8,8,5,34" Stroke="Black"/>
+ <Rectangle x:Name="VideoScreen" Margin="8,8,5,34" Stroke="Black">
+ <Rectangle.Fill>
+ <VideoBrush x:Name="VideoScreenBrush"/>
+ </Rectangle.Fill>
+ </Rectangle>
</Grid>
</UserControl>
\ No newline at end of file
--- a/client/src/Iri.Modernisation.Controls/View/WebCamControl/WebCamControl.xaml.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/WebCamControl/WebCamControl.xaml.cs Mon Jan 25 09:30:22 2010 +0100
@@ -25,7 +25,7 @@
VideoBrush vidBrush = new VideoBrush();
vidBrush.SetSource(_captureSource);
VideoScreen.Fill = vidBrush;
-
+
Commands.WebCamControl.CamRecordLanch.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CamRecordLanch_Executed);
Commands.WebCamControl.CamRecordStop.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CamRecordStop_Executed);
Commands.WebCamControl.CamRecordEnd.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CamRecordEnd_Executed);
--- a/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -16,6 +16,7 @@
using System.Linq;
using Iri.Modernisation.Controls.View;
using Iri.Modernisation.Data.LDTClass;
+
namespace Iri.Modernisation.Controls.ViewModel
{
@@ -270,6 +271,16 @@
Commands.ContextualBinderLayer.ActiveBind.Executed += new EventHandler<ExecutedEventArgs>(ActiveBind_Executed);
Commands.ContextualBinderLayer.DesactiveBind.Executed += new EventHandler<ExecutedEventArgs>(DesactiveBind_Executed);
Commands.AnnotationMaker.OkClick.Executed += new EventHandler<ExecutedEventArgs>(OkClickAnnotationMaker_Executed);
+ Commands.EscapeKeyPressed.Executed += new EventHandler<ExecutedEventArgs>(EscapeKeyPressed_Executed);
+ }
+
+ void EscapeKeyPressed_Executed(object sender, ExecutedEventArgs e)
+ {
+
+ PolemicRelation = new PolemicLink();
+ PolemicRelation.FromElement = _newAnnotation;
+
+
}
private void DesactiveBind_Executed(object sender, ExecutedEventArgs e)
@@ -366,9 +377,26 @@
};
newfile.Relations.Add(polemicRelation);
}
- MessageBox.Show(newfile.ToString());
+ //MessageBox.Show(newfile.ToString());
+
+
+ Application app = Application.Current as Application;
+ HttpSender helper = new HttpSender(new Uri("http://mtotet.free.fr/TestHttpSender/index.php"), "POST",
+ new KeyValuePair<string, string>("authKey", "123456" ),
+ new KeyValuePair<string, string>("newAnnotation", newfile.ToString()),
+ new KeyValuePair<string, string>("msg", "303"));
+ helper.ResponseComplete += new HttpResponseCompleteEventHandler(helper_ResponseComplete);
+ helper.Execute();
_refElement = null;
OnPropertyChanged("IsControlEnable");
+
+ }
+
+ void helper_ResponseComplete(HttpResponseCompleteEventArgs e)
+ {
+ String resp = e.Response;
+ MessageBox.Show(resp);
+
}
/// <summary>
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -263,9 +263,9 @@
_title = value.SelectedBook.Title;
_author = value.SelectedBook.Author;
_chapters = value.SelectedBook.Chapters;
-
+ ActualVideoSourceVM.Source = value.SelectedBook.MediaPath;
ActualVideoSourceVM.Position = TimeSpan.FromMilliseconds(value.Position);
- ActualVideoSourceVM.Source = value.SelectedBook.MediaPath;
+
SelectedIndex = value.SelectedBook.Chapters[0].Index[0];
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -21,6 +21,7 @@
/// </summary>
public class ConsultationViewVM : BaseMVVM.ViewModel.ViewModel
{
+
private PolemicElement _selectedElement;
/// <summary>
/// PolemicElement sélectionné
@@ -38,8 +39,6 @@
}
}
-
-
private ObservableCollection<BookTimeLineVM> _selectedVideoBooks;
/// <summary>
/// Liste des Livres Sélectionnés
@@ -93,35 +92,11 @@
OnPropertyChanged(null);
}
}
-
- private void InitializeCommands()
- {
- Commands.ConsultMenu.ClickBook.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickBook_Executed);
- Commands.PolemicElement.SelectPolemicElement.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(SelectPolemicElement_Executed);
-
- Commands.ClickMenu.CreateNewTextualAnnotation.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CreateNewTextualAnnotation_Executed);
- }
+ /// <summary>
+ /// Loader pour chargement à la volée des VideoLivres selectionnés
+ /// </summary>
+ private Loader<VideoBook> _loaderVideoBook { get; set; }
- private void ClickBook_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
- {
- BookTimeLineVM temp = new BookTimeLineVM((VideoBook)e.Parameter);
- temp.ViewModelVideoViewer = ConsultationBookViewContextMenu.ActualVideoSourceVM;
- bool CanAdd = true;
- foreach(BookTimeLineVM BookTLVM in SelectedVideoBooks)
- {
- if (BookTLVM.SelectedBook == (VideoBook)e.Parameter)
- {
- CanAdd = false;
- }
- }
- if(CanAdd)
- {
- SelectedVideoBooks.Add(temp);
- }
-
- }
-
-
private AnnotationMakerVM _annotationMakerVM;
/// <summary>
/// ViewModel de AnnotationMaker
@@ -138,6 +113,60 @@
OnPropertyChanged("ViewModelAnnotationMaker");
}
}
+
+ private void InitializeCommands()
+ {
+ Commands.ConsultMenu.ClickBook.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickBook_Executed);
+ Commands.PolemicElement.SelectPolemicElement.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(SelectPolemicElement_Executed);
+ Commands.ClickMenu.CreateNewTextualAnnotation.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CreateNewTextualAnnotation_Executed);
+ }
+
+ /// <summary>
+ /// Evenement lors d'un click sur un livre de la liste
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ClickBook_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ {
+
+ bool CanAdd = true;
+ //On regarde si le VideoLivre qu'on à choisis n'est pas déjà dans la liste des VideoLivres sélectionné
+ foreach (BookTimeLineVM BookTLVM in SelectedVideoBooks)
+ {
+ if (BookTLVM.SelectedBook.LdtPath == ((VideoBook)e.Parameter).LdtPath)
+ {
+ CanAdd = false;
+ }
+ }
+ if (CanAdd)
+ {
+ //Préparation du loader
+ _loaderVideoBook = new Loader<VideoBook>(LDTFileReader.ConvertToVideoBook);
+ _loaderVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<VideoBook>>(LoaderVideoBook_LoaderFinished);
+ _loaderVideoBook.Load(((VideoBook)e.Parameter).LdtPath);
+ }
+
+
+ }
+
+ /// <summary>
+ /// Fonction une fois que le fichier .ldt à été chargé
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void LoaderVideoBook_LoaderFinished(object sender, LoaderEventArgs<VideoBook> e)
+ {
+ VideoBook addedVideoBook = e.CreatedObject;
+ ///------- ///
+ addedVideoBook.LdtPath = _loaderVideoBook.Path;
+ ///-----------------///
+ BookTimeLineVM temp = new BookTimeLineVM(addedVideoBook);
+ temp.ViewModelVideoViewer = ConsultationBookViewContextMenu.ActualVideoSourceVM;
+ SelectedVideoBooks.Add(temp);
+
+ }
+
+
private void CreateNewTextualAnnotation_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
{
ViewModelAnnotationMaker.RefElement=SelectedElement;
@@ -160,9 +189,6 @@
catch
{
}
-
-
-
}
}
}
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionEditor/ProductionEditorVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionEditor/ProductionEditorVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -32,6 +32,19 @@
}
}
+ private WebCamControlVM _webCamControlVM;
+ public WebCamControlVM ViewModelWebCamControl
+ {
+ get
+ {
+ return _webCamControlVM;
+ }
+ set
+ {
+ _webCamControlVM = value;
+ OnPropertyChanged("ViewModelWebCamControl");
+ }
+ }
private VideoViewerVM _videoViewerVM;
public VideoViewerVM ViewModelVideoViewer
{
@@ -159,6 +172,7 @@
public ProductionEditorVM()
{
+ ViewModelWebCamControl = new WebCamControlVM();
InitializeCommands();
}
public ProductionEditorVM(VideoSequence Vs)
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -14,7 +14,7 @@
using Iri.Modernisation.Controls.View;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-
+using Iri.Modernisation.Data.LDTClass;
namespace Iri.Modernisation.Controls.ViewModel
{
/// <summary>
@@ -266,7 +266,7 @@
Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartFinished_Executed);
Commands.ProductionView.ClickAddIndex.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddIndex_Executed);
Commands.TimeChange.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(TimeChange_Executed);
- #endregion
+ #endregion
#region VideoSequences CollectionChanged
@@ -283,6 +283,8 @@
}
#endregion
}
+
+
public ProductionTimeLineVM()
{
_newBook = new VideoBook();
@@ -315,8 +317,9 @@
if (Vs.TimerIn.TotalMilliseconds <= newValue && Vs.TimerOut.TotalMilliseconds > newValue)
{
ActualVideoSequence = Vs;
- ViewModelVideoViewer.Source = ActualVideoSequence.Path;
+ ViewModelVideoViewer.Source = ActualVideoSequence.Path;
ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - Vs.TimerIn +Vs.BeginTrim);
+
}
}
}
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -14,6 +14,7 @@
using Iri.Modernisation.Data.Models;
using System.Collections.ObjectModel;
using System.Collections.Generic;
+using Iri.Modernisation.Data.LDTClass;
namespace Iri.Modernisation.Controls.ViewModel
{
/// <summary>
@@ -126,13 +127,16 @@
OnPropertyChanged("ViewModelMasterVideoViewer");
}
}
-
+
+
private void InitializeCommands()
{
Commands.ProductionView.ClickAddSelectedRecord.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddSelectedRecord_Executed);
ViewModelProductionTimeLine.SwitchVideo += new EventHandler<ProductionTimeLineVMEventArgs>(ViewModelProductionTimeLine_SwitchVideo);
ViewModelMasterVideoViewer.Tick += new EventHandler<VideoViewerVMEventArgs>(ViewModelMasterVideoViewer_Tick);
ViewModelHeaderProduction.Change += new EventHandler<HeaderProductionVMArgs>(ViewModelHeaderProduction_Change);
+ Commands.HeaderProduction.PublishClick.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(PublishClick_Executed);
+
}
public ProductionViewVM()
{
@@ -141,7 +145,7 @@
ViewModelProductionTimeLine = new ProductionTimeLineVM();
ViewModelProductionEditor = new ProductionEditorVM();
ViewModelMasterVideoViewer = new VideoViewerVM(true, false);
-
+
ViewModelProductionTimeLine.ViewModelVideoViewer = ViewModelMasterVideoViewer;
Random rndNumbers = new Random();
_recordedVideoSequences.Add(new VideoSequence()
@@ -155,7 +159,7 @@
_recordedVideoSequences.Add(new VideoSequence()
{
- Path = "http://localhost:1942/video.mp4",
+ Path = "/video.mp4",
RunTime = new TimeSpan(0, rndNumbers.Next(10, 60), 0),
BeginTrim = new TimeSpan(0, 0, 0),
EndTrim = new TimeSpan(0, 0, 0),
@@ -166,10 +170,67 @@
OnPropertyChanged(String.Empty);
}
+ void PublishClick_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ {
+ IRIFile newFile = new IRIFile();
+ IRIDecoupage decoupage = new IRIDecoupage()
+ {
+ Author = "this author",
+ Id = "Index"
+ };
+ foreach (ObservableCollection<SegmentIndex> Ocsi in this.ViewModelProductionTimeLine.ListIndex)
+ {
+ foreach (SegmentIndex si in Ocsi)
+ {
+ IRIElement temp = new IRIElement()
+ {
+
+ Chapter = si.Chapter.IdChap,
+ Begin = si.TimerIn,
+ Dur = si.Duration,
+ Title = si.Description,
+ Abstract = si.Description,
+ Tags = si.Tags
+ };
+ decoupage.Elements.Add(temp);
+ }
+
+ }
+ IRIMedia videoMedia = new IRIMedia() { Id = "video" };
+
+
+ foreach (VideoSequence vs in this.ViewModelProductionTimeLine.TimeLine)
+ {
+ videoMedia.Videos.Add(new IRIVideo()
+ {
+ Begin = vs.TimerIn,
+ Dur = vs.Duration,
+ Src = vs.Path,
+
+ }
+ );
+ }
+ IRIEnsemble ensemble = new IRIEnsemble()
+ {
+ Id = "VideoBookIndex"
+ };
+ ensemble.Decoupages.Add(decoupage);
+ newFile.Body.Ensembles.Add(ensemble);
+ newFile.Body.Medias.Add(videoMedia);
+
+ MessageBox.Show(newFile.ToString());
+ }
void ViewModelHeaderProduction_Change(object sender, HeaderProductionVMArgs e)
{
- ViewModelProductionTimeLine.IsIndexing = e.ChapterHeader.Editing;
+ if (e.ChapterHeader.Indexing == false && e.ChapterHeader.Editing == true)
+ {
+ ViewModelProductionTimeLine.IsIndexing = true;
+ }
+ else
+ {
+ ViewModelProductionTimeLine.IsIndexing = false;
+ }
ViewModelProductionTimeLine.SelectedChapter = e.ChapterHeader.ChapterDescription.Id ;
}
--- a/client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -139,6 +139,10 @@
{
Commands.VideoViewer.Pause.Execute(null, this);
}
+ public void Play()
+ {
+ Commands.VideoViewer.Play.Execute(this, this);
+ }
public void LaunchTick(TimeSpan Pos)
{
if(Tick!=null)
--- a/client/src/Iri.Modernisation.Controls/ViewModel/WebCamControl/WebCamControlVM.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/WebCamControl/WebCamControlVM.cs Mon Jan 25 09:30:22 2010 +0100
@@ -15,11 +15,53 @@
{
-
+ private CaptureSource _captureSource {get;set;}
+ public CaptureSource CaptureSource
+ {
+ get
+ {
+ return _captureSource;
+ }
+ set
+ {
+ _captureSource = value;
+ OnPropertyChanged("CaputreSource");
+ }
+ }
public WebCamControlVM()
{
-
-
+ Commands.WebCamControl.CamRecordLanch.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CamRecordLanch_Executed);
+ Commands.WebCamControl.CamRecordStop.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CamRecordStop_Executed);
+ Commands.WebCamControl.CamRecordEnd.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CamRecordEnd_Executed);
+ Commands.WebCamControl.CamRecordBegin.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(CamRecordBegin_Executed);
+
+ CaptureSource = new CaptureSource()
+ {
+ VideoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice(),
+ AudioCaptureDevice = CaptureDeviceConfiguration.GetDefaultAudioCaptureDevice()
+ };
+ }
+ void CamRecordStop_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ {
+ _captureSource.Stop();
+ }
+
+ void CamRecordEnd_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ {
+
+ }
+
+ void CamRecordLanch_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ {
+ if (CaptureDeviceConfiguration.AllowedDeviceAccess || CaptureDeviceConfiguration.RequestDeviceAccess())
+ {
+ _captureSource.Start();
+ }
+ }
+
+ void CamRecordBegin_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ {
+
}
}
}
--- a/client/src/Iri.Modernisation.Data/Iri.Modernisation.Data.csproj Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Iri.Modernisation.Data.csproj Mon Jan 25 09:30:22 2010 +0100
@@ -76,6 +76,7 @@
<Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Ldt\IRIBody.cs" />
<Compile Include="Ldt\IRIDecoupage.cs" />
<Compile Include="Ldt\IRIElement.cs" />
<Compile Include="Ldt\IRIEnsemble.cs" />
@@ -98,6 +99,7 @@
<Compile Include="Ldt\LDTRelation.cs" />
<Compile Include="Ldt\Readers.cs" />
<Compile Include="Models\Annotation.cs" />
+ <Compile Include="Models\HttpSender.cs" />
<Compile Include="Models\Loader.cs" />
<Compile Include="Models\PolemicTypeDescription.cs" />
<Compile Include="Models\AnnotationSession.cs" />
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIBody.cs Mon Jan 25 09:30:22 2010 +0100
@@ -0,0 +1,58 @@
+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;
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
+{
+ public class IRIBody
+ {
+ public List<IRIEnsemble> Ensembles;
+ public List<IRILink> Links;
+ public List<IRIMedia> Medias;
+ public List<IRIDecoupage> Displays;
+
+ public IRIBody()
+ {
+ Ensembles = new List<IRIEnsemble>();
+ Links = new List<IRILink>();
+ Medias = new List<IRIMedia>();
+ Displays = new List<IRIDecoupage>();
+ }
+
+ public XElement XML
+ {
+ get
+ {
+ XElement temp = new XElement("body");
+
+ XElement XEnsembles = new XElement("ensembles");
+ foreach (IRIEnsemble ensemble in Ensembles)
+ {
+ XEnsembles.Add(ensemble.XML);
+ }
+ temp.Add(XEnsembles);
+ temp.Add(new XElement("links"));
+ XElement XMedias = new XElement("medias");
+ foreach (IRIMedia media in Medias)
+ {
+ XMedias.Add(media.XML);
+ }
+ temp.Add(XMedias);
+
+
+
+ temp.Add(new XElement("display"));
+
+ return temp;
+ }
+ }
+ }
+}
--- a/client/src/Iri.Modernisation.Data/Ldt/IRIDecoupage.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIDecoupage.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,71 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Collections.Generic;
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIDecoupage
{
+
+
+ public String Id { get; set; }
+ public Color Color { get; set; }
+ public String Author { get; set; }
+ public DateTime Date { get; set; }
+ public int Display { get; set; }
+ public String Title { get; set; }
+ public String Label { get; set; }
+ public String Abstract { get; set; }
+ public List<IRIElement> Elements { get; set; }
+
+ public IRIDecoupage()
+ {
+ Id = String.Empty;
+ Color = Color.FromArgb(0, 0, 0, 0);
+ Author = String.Empty;
+ Date = DateTime.Now;
+ Display = 0;
+ Title = String.Empty;
+ Label = String.Empty;
+ Abstract = String.Empty;
+ Elements = new List<IRIElement>();
+ }
+ public IRIDecoupage(XElement elem)
+ {
+ Id = elem.Attribute("id").Value;
+ Color = Color.FromArgb(0, 0, 0, 0);
+ Author = elem.Attribute("author").Value;
+ Date = DateTime.Parse(elem.Attribute("date").Value);
+ Display = int.Parse(elem.Attribute("display").Value);
+ Title = elem.Attribute("title").Value;
+ Label = elem.Attribute("label").Value;
+ Abstract = elem.Attribute("abstract").Value;
+ foreach (XElement XIElement in elem.Element("elements").Elements())
+ {
+ Elements.Add(new IRIElement(XIElement));
+ }
+ }
+ public XElement XML
+ {
+ get
+ {
+ XElement temp = new XElement("decoupage",
+ new XAttribute("id", Id),
+ new XAttribute("color", Color),
+ new XAttribute("author", Author),
+ new XAttribute("date", Date.ToString("dd/MM/yyyy")),
+ new XAttribute("display", Display),
+ new XAttribute("title", Title),
+ new XAttribute("label", Label),
+ new XAttribute("abstract", Abstract));
+ foreach (IRIElement element in Elements)
+ {
+ temp.Add(element.XML);
+ }
+ return temp;
+ }
+ }
}
}
--- a/client/src/Iri.Modernisation.Data/Ldt/IRIElement.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIElement.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,103 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Xml.Linq;
+using System.Collections.Generic;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIElement
{
+ //<element id="elD_0" order="" prev="" next="" begin="0" dur="933" author="DDC - IRI" date="06/2006" title="plan 0" abstract="" src="testauthor_testtitle/thumbs/0_in.jpg"/>
+ public String Id { get; set; }
+ public int Order { get; set; }
+ public DateTime Date { get; set; }
+ public int Chapter { get; set; }
+ public String Prev { get; set; }
+ public String Next { get; set; }
+ public TimeSpan Begin { get; set; }
+ public TimeSpan Dur { get; set; }
+ public String Author { get; set; }
+ public String Title { get; set; }
+ public String Abstract { get; set; }
+ public String Src { get; set; }
+ public List<String> Tags { get; set; }
+
+ public IRIElement()
+ {
+ Id = String.Empty;
+ Order = 0;
+ Chapter = 0;
+ Prev = String.Empty;
+ Next = String.Empty;
+ Begin = TimeSpan.Zero;
+ Dur = TimeSpan.Zero;
+ Author = String.Empty;
+ Title = String.Empty;
+ Abstract = String.Empty;
+ Src = String.Empty;
+ Tags = new List<string>();
+ }
+ public IRIElement(XElement elem)
+ {
+ Id = elem.Attribute("id").Value;
+ Order = int.Parse(elem.Attribute("order").Value);
+ Prev = elem.Attribute("prev").Value;
+ Next = elem.Attribute("next").Value;
+ Begin = TimeSpan.FromMilliseconds(double.Parse(elem.Attribute("begin").Value));
+ Dur = TimeSpan.FromMilliseconds(double.Parse(elem.Attribute("dur").Value));
+ Author = elem.Attribute("author").Value;
+ Title = elem.Attribute("title").Value;
+ Abstract = elem.Attribute("abstract").Value;
+ Src = elem.Attribute("src").Value;
+ if(elem.Element("tags")!=null)
+ {
+ foreach (XElement XTag in elem.Element("tags").Elements())
+ {
+ Tags.Add(XTag.Value);
+ }
+ }
+ if(elem.Element("chapter")!=null)
+ {
+ Chapter = int.Parse(elem.Element("chapter").Value);
+ }
+ if (elem.Element("date") != null)
+ {
+ Date = DateTime.Parse(elem.Element("date").Value);
+ }
+ else
+ {
+ Date = DateTime.Now;
+ }
+ }
+ public XElement XML
+ {
+ get
+ {
+ XElement temp = new XElement("element",
+ new XAttribute("id",Id),
+ new XAttribute("order",Order),
+ new XAttribute("date",Date.ToString("dd/MM/yyyy")),
+ new XAttribute("chapter",Chapter),
+ new XAttribute("prev",Prev),
+ new XAttribute("next",Next),
+ new XAttribute("begin",Begin.TotalMilliseconds),
+ new XAttribute("dur",Dur.TotalMilliseconds),
+ new XAttribute("author",Author),
+ new XElement("title",Title),
+ new XElement("abstract", Abstract),
+ new XAttribute("src",Src)
+ );
+ XElement Xtags = new XElement("tags");
+ foreach (String tag in Tags)
+ {
+ Xtags.Add(new XElement("tag", tag));
+ }
+ temp.Add(Xtags);
+
+
+ return temp;
+ }
+ }
}
}
--- a/client/src/Iri.Modernisation.Data/Ldt/IRIEnsemble.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIEnsemble.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,64 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Collections.Generic;
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIEnsemble
{
+ //ensemble id="en_2" author="DDC - IRI" date="06/2006" display="2" title="Image" abstract="Découpage visuel"
+ public String Id { get; set; }
+ public String Author { get; set; }
+ public DateTime Date { get; set; }
+ public int Display { get; set; }
+ public String Title { get; set; }
+ public String Abstract { get; set; }
+ public List<IRIDecoupage> Decoupages { get; set; }
+
+ public IRIEnsemble()
+ {
+ Id = String.Empty;
+ Author = String.Empty;
+ Date = DateTime.Now;
+ Display = 0;
+ Title = String.Empty;
+ Abstract = String.Empty;
+ Decoupages = new List<IRIDecoupage>();
+ }
+
+ public IRIEnsemble(XElement elem)
+ {
+ Id = elem.Attribute("id").Value;
+ Author = elem.Attribute("author").Value;
+ Date = DateTime.Parse(elem.Attribute("date").Value);
+ Display = int.Parse(elem.Attribute("display").Value);
+ Title = elem.Attribute("title").Value;
+ Abstract = elem.Attribute("abstract").Value;
+ foreach (XElement XDecoupage in elem.Element("decoupages").Elements())
+ {
+ Decoupages.Add(new IRIDecoupage(XDecoupage));
+ }
+ }
+ public XElement XML
+ {
+ get
+ {
+ XElement temp = new XElement("ensemble",
+ new XAttribute("id",Id),
+ new XAttribute("author",Author),
+ new XAttribute("date", Date.ToString("dd/MM/yyyy")),
+ new XAttribute("display",Display),
+ new XAttribute("title",Title),
+ new XAttribute("abstract",Abstract));
+ foreach (IRIDecoupage decoupage in Decoupages)
+ {
+ temp.Add(decoupage.XML);
+ }
+ return temp;
+
+ }
+ }
}
}
--- a/client/src/Iri.Modernisation.Data/Ldt/IRIFile.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIFile.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,76 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Collections.Generic;
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIFile
{
+ public List<IRIMeta> Head { get; set; }
+ public IRIBody Body { get; set; }
+ public IRIFile()
+ {
+ Head = new List<IRIMeta>();
+ Body = new IRIBody();
+ }
+
+ public XDocument XMLFile
+ {
+ get
+ {
+ return new XDocument(XML);
+
+ }
+
+ }
+
+ public override String ToString()
+ {
+ return XML.ToString();
+ }
+
+ public XElement XML
+ {
+ get
+ {
+
+ XElement temp = new XElement("iri");
+
+ XElement Xhead = new XElement("head");
+ foreach (IRIMeta meta in Head)
+ {
+ Xhead.Add(meta.XML);
+ }
+ temp.Add(Xhead);
+
+ temp.Add(Body.XML);
+
+
+ return temp;
+ }
+ }
+ public static IRIFile FromXML(XDocument xdoc)
+ {
+ IRIFile returnFile = new IRIFile();
+ foreach (XElement Elem in xdoc.Root.Element("head").Elements())
+ {
+ returnFile.Head.Add(new IRIMeta(Elem));
+ }
+
+ XElement XBody = xdoc.Root.Element("body");
+ foreach (XElement Elem in XBody.Element("ensembles").Elements())
+ {
+ returnFile.Body.Ensembles.Add(new IRIEnsemble(Elem));
+ }
+
+ foreach (XElement Elem in XBody.Element("medias").Elements())
+ {
+ returnFile.Body.Medias.Add(new IRIMedia(Elem));
+ }
+
+ return returnFile;
+ }
}
}
--- a/client/src/Iri.Modernisation.Data/Ldt/IRILink.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRILink.cs Mon Jan 25 09:30:22 2010 +0100
@@ -9,7 +9,7 @@
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-namespace Iri.Modernisation.Data.Ldt
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRILink
{
--- a/client/src/Iri.Modernisation.Data/Ldt/IRIMedia.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIMedia.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,39 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Collections.Generic;
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIMedia
{
+ public String Id { get; set; }
+ public List<IRIVideo> Videos { get; set; }
+ public IRIMedia()
+ {
+ Id = String.Empty;
+ Videos = new List<IRIVideo>();
+ }
+ public IRIMedia(XElement elem)
+ {
+ Id = elem.Attribute("id").Value;
+ foreach (XElement XVideos in elem.Elements())
+ {
+ Videos.Add(new IRIVideo(XVideos));
+ }
+ }
+ public XElement XML
+ {
+ get
+ {
+ XElement temp = new XElement("media",new XAttribute("id",Id));
+ foreach (IRIVideo video in Videos)
+ {
+ temp.Add(video.XML);
+ }
+ return temp;
+ }
+ }
}
}
--- a/client/src/Iri.Modernisation.Data/Ldt/IRIMeta.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIMeta.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,33 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIMeta
{
+ public String Name { get; set; }
+ public String Content { get; set; }
+ public IRIMeta()
+ {
+ Name = String.Empty;
+ Content = String.Empty;
+ }
+ public IRIMeta(XElement elem)
+ {
+ Name = elem.Attribute("name").Value;
+ Content = elem.Attribute("content").Value;
+ }
+
+ public XElement XML
+ {
+ get
+ {
+ return new XElement("meta",
+ new XAttribute("name", Name),
+ new XAttribute("content",Content));
+ }
+ }
}
}
--- a/client/src/Iri.Modernisation.Data/Ldt/IRIVideo.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIVideo.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,46 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIVideo
{
+ // id="a12" q="MQ" begin="0" dur="239333" src="testauthor_testtitle/testauthor_testtitle.flv"
+ public String Id { get; set; }
+ public String Q { get; set; }
+ public TimeSpan Begin { get; set; }
+ public TimeSpan Dur { get; set; }
+ public String Src { get; set; }
+
+ public IRIVideo()
+ {
+ Id = String.Empty;
+ Q = String.Empty;
+ Begin = TimeSpan.Zero;
+ Dur = TimeSpan.Zero;
+ Src = String.Empty;
+ }
+ public IRIVideo(XElement elem)
+ {
+ Id = elem.Attribute("id").Value;
+ Q = elem.Attribute("q").Value;
+ Begin = TimeSpan.FromMilliseconds(double.Parse(elem.Attribute("begin").Value));
+ Dur = TimeSpan.FromMilliseconds(double.Parse(elem.Attribute("dur").Value));
+ Src = elem.Attribute("src").Value;
+ }
+ public XElement XML
+ {
+ get
+ {
+ return new XElement("video",
+ new XAttribute("id",Id),
+ new XAttribute("q",Q),
+ new XAttribute("begin",Begin.TotalMilliseconds),
+ new XAttribute("dur",Dur.TotalMilliseconds),
+ new XAttribute("src",Src));
+ }
+ }
}
}
--- a/client/src/Iri.Modernisation.Data/Ldt/LDTFile.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/LDTFile.cs Mon Jan 25 09:30:22 2010 +0100
@@ -98,6 +98,40 @@
}
}
}
+ static public LDTFile FromXML(XDocument xdoc)
+ {
+ LDTFile returnFile = new LDTFile();
+ returnFile.Project = new LDTProject(xdoc.Root.Element("project"));
+ foreach (XElement Elem in xdoc.Root.Element("medias").Elements())
+ {
+ returnFile.Medias.Add(new LDTMedia(Elem));
+ }
+
+ foreach (XElement Elem in xdoc.Root.Element("annotations").Elements())
+ {
+ returnFile.Annotations.Add(new LDTAnnotationsContent(Elem));
+ }
+
+ foreach (XElement Elem in xdoc.Root.Element("displays").Elements())
+ {
+ returnFile.Displays.Add(new LDTDisplay(Elem));
+ }
+
+ foreach (XElement Elem in xdoc.Root.Element("edits").Elements())
+ {
+ returnFile.Edits.Add(new LDTEditing(Elem));
+ }
+
+ if (xdoc.Root.Element("realtions") != null)
+ {
+ foreach (XElement Elem in xdoc.Root.Element("realtions").Elements())
+ {
+ returnFile.Relations.Add(new LDTRelation(Elem));
+ }
+ }
+ return returnFile;
+ }
+
public XDocument XMLFile
{
get
--- a/client/src/Iri.Modernisation.Data/Ldt/Readers.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/Readers.cs Mon Jan 25 09:30:22 2010 +0100
@@ -18,7 +18,9 @@
{
LDTFile _ldtFile = new LDTFile();
_ldtFile.Load(Path);
+
VideoBook _videoBook = new VideoBook();
+
if (_ldtFile != null)
{
// Initialisation du VideoBook
@@ -32,7 +34,7 @@
},
Duration = new TimeSpan(),
IriPath = _ldtFile.Medias[0].Src,
- LdtPath = Path.BaseUri,
+ LdtPath = _ldtFile.Path,
};
@@ -107,5 +109,114 @@
}
}
+ public static VideoBook ConvertToVideoBook(LDTFile ldt, IRIFile iri)
+ {
+ VideoBook _videoBook = new VideoBook();
+ // Initialisation du VideoBook
+ _videoBook = new VideoBook()
+ {
+ Title = ldt.Project.Title,
+ Author = new User()
+ {
+ UserName = ldt.Project.User,
+
+ },
+ Duration = new TimeSpan(),
+ IriPath = ldt.Medias[0].Src,
+ LdtPath = ldt.Path,
+
+ };
+
+ // Initialisation des index
+
+ foreach (LDTAnnotationsContent LDTAC in ldt.Annotations)
+ {
+ //int count = 0;
+ int decoupage = LDTAC.Content[2].Elements.Count / 4;
+ //int selectedChapter = 0;
+
+ for (int eloop = 0; eloop < iri.Body.Ensembles.Count; eloop++)
+ {
+ if (iri.Body.Ensembles[eloop].Id == "VideoBookIndex")
+ {
+ for (int dloop = 0; dloop < iri.Body.Ensembles[eloop].Decoupages.Count; dloop++)
+ {
+ if(iri.Body.Ensembles[eloop].Decoupages[dloop].Id=="Index")
+ {
+ foreach (IRIElement elem in iri.Body.Ensembles[eloop].Decoupages[dloop].Elements)
+ {
+ _videoBook.Chapters[elem.Chapter].Index.Add(new SegmentIndex(_videoBook.Chapters[elem.Chapter])
+ {
+ Id = elem.Id,
+ Title = elem.Title,
+ Description = elem.Abstract,
+ Tags = elem.Tags,
+ TimerIn = elem.Begin,
+ Duration = elem.Dur
+
+ });
+ }
+ }
+ }
+ break;
+
+ }
+ }
+ /*
+ foreach (LDTElement LDTE in LDTAC.Content[2].Elements)
+ {
+ _videoBook.Chapters[selectedChapter].Index.Add(new SegmentIndex(_videoBook.Chapters[selectedChapter])
+ {
+ Id = LDTE.Id,
+ Title = LDTE.Title,
+ Description = LDTE.Abstract,
+ Tags = LDTE.Tags,
+ TimerIn = new TimeSpan(0, 0, 0, 0, (int)LDTE.Begin),
+ Duration = new TimeSpan(0, 0, 0, 0, (int)LDTE.Dur),
+
+ });
+ count++;
+ if (count % decoupage == 0)
+ {
+ selectedChapter++;
+ if (selectedChapter >= 4)
+ {
+ selectedChapter = 3;
+ }
+ }
+
+ _videoBook.Duration = _videoBook.Duration.Add(new TimeSpan(0, 0, 0, 0, (int)LDTE.Dur));
+ }*/
+ foreach (LDTElement LDTE in LDTAC.Content[3].Elements)
+ {
+ _videoBook.Chapters[0].Annotations.Add(new Annotation(_videoBook.Chapters[0])
+ {
+ Id = LDTE.Id,
+ Title = LDTE.Title,
+ Description = LDTE.Abstract,
+ Tags = LDTE.Tags,
+ TimerIn = new TimeSpan(0, 0, 0, 0, (int)LDTE.Begin),
+ Duration = new TimeSpan(0, 0, 0, 0, (int)(LDTE.Dur + 5000)),
+ Type = FactoryVideoLivre.AnnotationDescriptions[0]
+ });
+ // _videoBook.Duration = _videoBook.Duration.Add(new TimeSpan(0, 0, 0, 0, (int)(LDTE.Dur)));
+ }
+ foreach (LDTElement LDTE in LDTAC.Content[1].Elements)
+ {
+ _videoBook.Chapters[0].Annotations.Add(new Annotation(_videoBook.Chapters[0])
+ {
+ Title = LDTE.Title,
+ Description = LDTE.Abstract,
+ Tags = LDTE.Tags,
+ TimerIn = new TimeSpan(0, 0, 0, 0, (int)LDTE.Begin),
+ Duration = new TimeSpan(0, 0, 0, 0, (int)LDTE.Dur),
+ Type = FactoryVideoLivre.AnnotationDescriptions[1]
+ });
+ // _videoBook.Duration = _videoBook.Duration.Add(new TimeSpan(0, 0, 0, 0, (int)LDTE.Dur));
+ }
+
+ }
+ return _videoBook;
+ }
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/Iri.Modernisation.Data/Models/HttpSender.cs Mon Jan 25 09:30:22 2010 +0100
@@ -0,0 +1,132 @@
+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;
+using System.IO;
+using System.Threading;
+namespace Iri.Modernisation.Data.Models
+{
+ public class HttpSender
+ {
+ private HttpWebRequest Request { get; set; }
+ public Dictionary<string, string> PostValues { get; private set; }
+ public String Response { get; private set; }
+
+ public event HttpResponseCompleteEventHandler ResponseComplete;
+ private void OnResponseComplete(HttpResponseCompleteEventArgs e)
+ {
+ if (this.ResponseComplete != null)
+ {
+ this.ResponseComplete(e);
+ }
+ }
+ private void OnResponseComplete()
+ {
+ if (this.ResponseComplete != null)
+ {
+ this.ResponseComplete(new HttpResponseCompleteEventArgs(Response));
+ }
+ }
+ public HttpSender(Uri requestUri, string method, params KeyValuePair<string, string>[] postValues)
+ {
+ this.Request = (HttpWebRequest)WebRequest.Create(requestUri);
+ this.Request.ContentType = "application/x-www-form-urlencoded";
+ this.Request.Method = method;
+ this.PostValues = new Dictionary<string, string>();
+ if (postValues != null && postValues.Length > 0)
+ {
+ foreach (var item in postValues)
+ {
+ this.PostValues.Add(item.Key, item.Value);
+ }
+ }
+ }
+
+ public void Execute()
+ {
+ this.Request.BeginGetRequestStream(new AsyncCallback(BeginRequest), this);
+
+ }
+
+ private void BeginRequest(IAsyncResult ar)
+ {
+ HttpSender helper = ar.AsyncState as HttpSender;
+ if (helper != null)
+ {
+ if (helper.PostValues.Count > 0)
+ {
+ using (StreamWriter writer = new StreamWriter(helper.Request.EndGetRequestStream(ar)))
+ {
+ foreach (var item in helper.PostValues)
+ {
+ writer.Write("{0}={1}&", item.Key,item.Value);
+ }
+
+ }
+ }
+ helper.Request.BeginGetResponse(new AsyncCallback(BeginResponse), helper);
+ }
+ }
+
+ private void BeginResponse(IAsyncResult ar)
+ {
+ HttpSender helper = ar.AsyncState as HttpSender;
+ if (helper != null)
+ {
+ HttpWebResponse response = (HttpWebResponse)helper.Request.EndGetResponse(ar);
+ if (response != null)
+ {
+ Stream stream = response.GetResponseStream();
+ if (stream != null)
+ {
+ using (StreamReader reader = new StreamReader(stream))
+ {
+ helper.Response = reader.ReadToEnd();
+ }
+ }
+ }
+ }
+ this.OnResponseComplete();
+ }
+ }
+
+ public delegate void HttpResponseCompleteEventHandler(HttpResponseCompleteEventArgs e);
+ public class HttpResponseCompleteEventArgs : EventArgs
+ {
+ public string Response { get; set; }
+
+ public HttpResponseCompleteEventArgs(string response)
+ {
+ this.Response = response;
+ }
+ }
+
+
+ /*
+ using Of the class
+ private void ProcessCommand(short cmd, string msg)
+ {
+ App app = App.Current as App;
+ HttpHelper helper = new HttpHelper(app.ServerUri, "POST",
+ new KeyValuePair<string, string>("authKey", app.AuthKey),
+ new KeyValuePair<string, string>("cmd", cmd.ToString()),
+ new KeyValuePair<string, string>("msg", msg));
+ helper.ResponseComplete += new HttpResponseCompleteEventHandler(this.CommandComplete);
+ helper.Execute();
+
+ }
+
+ private void CommandComplete(HttpResponseCompleteEventArgs e)
+ {
+ txtAlert.Text = e.Response;
+ }
+ */
+
+}
--- a/client/src/Iri.Modernisation.Data/Models/Loader.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Models/Loader.cs Mon Jan 25 09:30:22 2010 +0100
@@ -14,14 +14,22 @@
using System.Threading;
namespace Iri.Modernisation.Data.Models
{
+
+ public interface ILoader
+ {
+ event EventHandler<LoaderEventArgs<ILoader>> LoaderFinished;
+ }
+
/// <summary>
/// Classe permettant de charger un XML et de convertir son contenu en un type ReturnType désiré
/// </summary>
/// <typeparam name="ReturnType">Type Désiré</typeparam>
- public class Loader<ResultType>
+ public class Loader<ResultType>
{
- public String Path { get; private set; }
+ private AutoResetEvent Are { get; set; }
+
+ public String Path { get; set; }
/// <summary>
/// WebClient qui permet de charger le XML distant
/// </summary>
@@ -45,12 +53,20 @@
/// Téléchargement des données
/// </summary>
/// <param name="path">Chemin du fichier</param>
- public void Load(String path)
+ public void Load(String path)
{
- Path = path;
+ //Here it's working
+ // Are.Set();
+ this.Path = path;
xmlClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(xmlClient_DownloadStringCompleted);
+
xmlClient.DownloadStringAsync(new Uri(path,UriKind.RelativeOrAbsolute));
-
+
+
+ //Here not
+ //Are.Set();
+
+
}
/// <summary>
@@ -58,29 +74,48 @@
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- void xmlClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
+ private void xmlClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
+
//On utilise la fonction donnée lors de la construction du Loader pour créer l'objet grâce au fichier XML
ResultType result = ProcessFunction.Invoke(XDocument.Parse(e.Result));
if (LoaderFinished != null)
{
//Une fois le Transtypage Fini, on lance l'évenement indiquant que le chargement est fini et donnant
// en argument l'objet créé.
+
LoaderFinished(this, new LoaderEventArgs<ResultType>(result));
+
+
}
}
-
+ public void Execute(Object sender)
+ {
+ Are = (AutoResetEvent)sender;
+ Load(this.Path);
+
+ }
public event EventHandler<LoaderEventArgs<ResultType>> LoaderFinished;
}
- public class LoaderEventArgs<ResultType> : EventArgs
+ public class LoaderEventArgs<ResultType> : EventArgs
{
public ResultType CreatedObject { get; private set; }
+ public AutoResetEvent Are { get; private set; }
public LoaderEventArgs(ResultType createdObject)
{
CreatedObject = createdObject;
+ Are = null;
+ }
+ public LoaderEventArgs(ResultType createdObject,AutoResetEvent are)
+ {
+ CreatedObject = createdObject;
+ Are = are;
+
}
}
+
+
}
--- a/client/src/Iri.Modernisation.Data/Models/SettingsProject.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Models/SettingsProject.cs Mon Jan 25 09:30:22 2010 +0100
@@ -17,13 +17,14 @@
/// </summary>
public static class SettingsProject
{
- /// <summary>
- /// Liste des vidéoLivre Disponible
- /// </summary>
+
+
static public List<VideoBook> ListVideoBook { get; set; }
static SettingsProject()
{
+ //_internalDictionary.Add(new Loader<List<VideoBook>>(VideoBook.GetListVideoBook),
+ // new KeyValuePair<string, object>("", null));
}
/// <summary>
/// (Télé)Chargement des données;
@@ -34,6 +35,7 @@
FactoryVideoLivre.Initialize();
FactoryVideoLivre.FactoryReady += new EventHandler(FactoryVideoLivre_FactoryReady);
FactoryVideoLivre.LoadXMLFile(configFileURI);
+
}
/// <summary>
@@ -43,10 +45,13 @@
/// <param name="e"></param>
static void FactoryVideoLivre_FactoryReady(object sender, EventArgs e)
{
-
- VideoBookLoaderHelper LoaderVideoBook = new VideoBookLoaderHelper(FactoryVideoLivre.VideoBookListPath);
- LoaderVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<List<VideoBook>>>(LoaderVideoBook_LoaderFinished);
-
+
+ Loader<List<VideoBook>> loaderListVideoBook = new Loader<List<VideoBook>>(VideoBook.GetListVideoBook);
+ loaderListVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<List<VideoBook>>>(LoaderVideoBook_LoaderFinished);
+ loaderListVideoBook.Load(FactoryVideoLivre.VideoBookListPath);
+ // VideoBookLoaderHelper LoaderVideoBook = new VideoBookLoaderHelper(FactoryVideoLivre.VideoBookListPath);
+ // LoaderVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<List<VideoBook>>>(LoaderVideoBook_LoaderFinished);
+
}
--- a/client/src/Iri.Modernisation.Data/Models/VideoBook.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Models/VideoBook.cs Mon Jan 25 09:30:22 2010 +0100
@@ -54,6 +54,8 @@
/// </summary>
public String IriPath { get; set; }
+
+
/// <summary>
/// Constructeur par défaut
/// </summary>
@@ -71,61 +73,66 @@
}
-
-
+ /// <summary>
+ /// Méthode static pour le Loader de la list de videoBook
+ /// </summary>
+ /// <param name="XDoc">XDoc du fichier pointant tous les chemin .ldt des videoLivre disponible</param>
+ /// <returns>List des VideoLivre (non chargé)</returns>
+ public static List<VideoBook> GetListVideoBook(XDocument XDoc)
+ {
+
+ List<VideoBook> ListReturn = new List<VideoBook>();
+
+ foreach (XElement XVideoBook in XDoc.Root.Elements())
+ {
+
+ VideoBook temp = new VideoBook();
+ temp.LdtPath = XVideoBook.Attribute("metafile").Value; ;
+ temp.Title = XVideoBook.Attribute("title").Value;
+ ListReturn.Add(temp);
+
+
+ }
+ return ListReturn;
+ }
}
- public class VideoBookLoaderHelper
+
+ public class VideoBookLoader
{
- private WebClient webclient;
- private List<VideoBook> returnVideoBookList;
- private int nbOfBook;
- public VideoBookLoaderHelper(String path)
+ private Loader<IRIFile> _iriFile;
+ private Loader<LDTFile> _ldtFile;
+ private IRIFile _loadedIriFile;
+ private LDTFile _loadedLdtFile;
+ public VideoBookLoader()
{
- nbOfBook = 0;
- returnVideoBookList = new List<VideoBook>();
- webclient = new WebClient();
- webclient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webclient_DownloadStringCompleted);
- webclient.DownloadStringAsync(new Uri(path,UriKind.RelativeOrAbsolute ));
+ _iriFile = new Loader<IRIFile>(IRIFile.FromXML);
+ _ldtFile = new Loader<LDTFile>(LDTFile.FromXML);
+ _ldtFile.LoaderFinished += new EventHandler<LoaderEventArgs<LDTFile>>(_ldtFile_LoaderFinished);
+ _iriFile.LoaderFinished += new EventHandler<LoaderEventArgs<IRIFile>>(_iriFile_LoaderFinished);
}
- void webclient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
+ void _iriFile_LoaderFinished(object sender, LoaderEventArgs<IRIFile> e)
{
- XDocument XDoc = XDocument.Parse(e.Result);
- List<VideoBook> ListReturn = new List<VideoBook>();
-
- foreach (XElement XVideoBook in XDoc.Root.Elements())
- {
- Loader<VideoBook> LoaderVideoBook = new Loader<VideoBook>(LDTFileReader.ConvertToVideoBook);
- LoaderVideoBook.LoaderFinished += new EventHandler<LoaderEventArgs<VideoBook>>(LoaderVideoBook_LoaderFinished);
+ _loadedIriFile = e.CreatedObject;
+ LoaderFinished(this,new LoaderEventArgs<VideoBook>(LDTFileReader.ConvertToVideoBook(_loadedLdtFile,_loadedIriFile)));
+ }
- LoaderVideoBook.Load(XVideoBook.Attribute("metafile").Value);
+ void _ldtFile_LoaderFinished(object sender, LoaderEventArgs<LDTFile> e)
+ {
+ _loadedLdtFile = e.CreatedObject;
+ _iriFile.Load(_loadedLdtFile.Medias[0].Src);
+
+ }
- nbOfBook++;
-
- }
+ public event EventHandler<LoaderEventArgs<VideoBook>> LoaderFinished;
- }
+ }
- void LoaderVideoBook_LoaderFinished(object sender, LoaderEventArgs<VideoBook> e)
- {
- e.CreatedObject.LdtPath = ((Loader<VideoBook>)sender).Path ;
- returnVideoBookList.Add(e.CreatedObject);
- if(returnVideoBookList.Count == nbOfBook)
- {
- if(LoaderFinished!=null)
- {
- LoaderFinished(this,new LoaderEventArgs<List<VideoBook>>(returnVideoBookList));
- }
- }
- }
- public event EventHandler<LoaderEventArgs<List<VideoBook>>> LoaderFinished;
-
-
- }
+
/// <summary>
/// Comparateur pour Trier les livres
/// </summary>
--- a/client/test/WebTest/WebTest/WebTest.Web/WebTest.Web.csproj Tue Jan 19 09:49:56 2010 +0100
+++ b/client/test/WebTest/WebTest/WebTest.Web/WebTest.Web.csproj Mon Jan 25 09:30:22 2010 +0100
@@ -75,7 +75,7 @@
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
- <DevelopmentServerPort>1942</DevelopmentServerPort>
+ <DevelopmentServerPort>2222</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>