LeftClick on an element in BookTimeLine set time at begining of the element.
authortotetm <>
Wed, 10 Feb 2010 14:56:46 +0100
changeset 41 b51a10574e7f
parent 40 581829b5ddd9
child 42 594fdedecf7f
LeftClick on an element in BookTimeLine set time at begining of the element.
client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs
client/src/Iri.Modernisation.Controls/View/BookTimeLine/BookTimeLine.xaml
client/src/Iri.Modernisation.Controls/View/BookTimeLine/BookTimeLine.xaml.cs
client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/FranceInterENMI29.ldt
--- a/client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs	Wed Feb 10 14:09:58 2010 +0100
+++ b/client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs	Wed Feb 10 14:56:46 2010 +0100
@@ -553,8 +553,14 @@
             static BookTimeLine()
             {
                 SaveAnnotations = new Command("SaveAnnotations");
+                LeftClickOnElement = new Command("LeftClickOnElement");
         
             }
+            public static Command LeftClickOnElement
+            {
+                get;
+                private set;
+            }
             public static Command SaveAnnotations
             {
                 get;
--- a/client/src/Iri.Modernisation.Controls/View/BookTimeLine/BookTimeLine.xaml	Wed Feb 10 14:09:58 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/BookTimeLine/BookTimeLine.xaml	Wed Feb 10 14:56:46 2010 +0100
@@ -21,7 +21,7 @@
 				<TextBlock x:Name="BookTitleLabel"  Text="{Binding Title, Mode=TwoWay}" TextWrapping="Wrap" Width="200" Margin="0,0,0,15" Height="18" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5"/>
 			</StackPanel>
 			<ToggleButton x:Name="DisplayCommentButton"  Content="Display" Width="88" IsChecked="True"/>
-			<Button x:Name="saveAnnotationsButton" Content="Save" Width="60" Input:CommandService.Command="SaveAnnotations"/>
+			<!--<Button x:Name="saveAnnotationsButton" Content="Save" Width="60" Input:CommandService.Command="SaveAnnotations"/>-->
 			<Slider x:Name="ScaleTimeLine" Height="31" HorizontalAlignment="Left" Margin="143,0,1,0"  Width="138" Value="{Binding ScaleValue, Mode=TwoWay}" Minimum="1" Maximum="10" />
 			
 		</StackPanel>
--- a/client/src/Iri.Modernisation.Controls/View/BookTimeLine/BookTimeLine.xaml.cs	Wed Feb 10 14:09:58 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/BookTimeLine/BookTimeLine.xaml.cs	Wed Feb 10 14:56:46 2010 +0100
@@ -26,7 +26,7 @@
             BookTimeLineSlider.ThumbDragStarted += new EventHandler<EventArgs>(TimeSlider_ThumbDragCompleted);
             BookTimeLineSlider.ThumbDragCompleted += new EventHandler<EventArgs>(TimeSlider_ThumbDragCompleted);
             BookTimeLineSlider.MouseLeftButtonUp += new MouseButtonEventHandler(BookTimeLineSlider_MouseLeftButtonUp);
-            saveAnnotationsButton.Click += new RoutedEventHandler(saveAnnotationsButton_Click);
+            //saveAnnotationsButton.Click += new RoutedEventHandler(saveAnnotationsButton_Click);
             Commands.AnnotationMaker.NewAnnotationFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(NewAnnotationFinished_Executed);
         }
 
@@ -92,6 +92,7 @@
                     double timeleft = (double)((Index.TimerIn.TotalMilliseconds  / BookTimeLineVM.ratioPixMs) * ScaleTimeLine.Value);
                     Canvas.SetLeft(pol,timeleft);
                     pol.Width = (Index.Duration.TotalMilliseconds / BookTimeLineVM.ratioPixMs) * ScaleTimeLine.Value;
+                    pol.MouseLeftButtonUp += new MouseButtonEventHandler(Element_MouseLeftButtonUp);
                 }
             }
             int basi = 0;
@@ -130,12 +131,22 @@
                  //   pol.Width = (Annotation.Duration.TotalMilliseconds * ScaleTimeLine.Value) / VM.TotalDuration;
                     pol.Width = (Annotation.Duration.TotalMilliseconds / BookTimeLineVM.ratioPixMs)* ScaleTimeLine.Value;
                     BookTimeLineAnnotationPanel.Children.Add(pol);
+                    pol.MouseLeftButtonUp += new MouseButtonEventHandler(Element_MouseLeftButtonUp);
                     basi = 0;
                 }
             }
             BookTimeLineElementPanel.UpdateLayout();
         }
 
+        void Element_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            PolemicElementVM VMPolemicElement = ((PolemicElementVM)((PolemicElementControl)sender).DataContext);
+           
+                Commands.BookTimeLine.LeftClickOnElement.Execute(VMPolemicElement.TimerIn, VMPolemicElement);
+               
+            
+        }
+
        
 
         
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs	Wed Feb 10 14:09:58 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs	Wed Feb 10 14:56:46 2010 +0100
@@ -120,6 +120,17 @@
             Commands.ConsultMenu.ClickBook.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickBook_Executed);
             Commands.PolemicElement.SelectPolemicElement.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(SelectPolemicElement_Executed);
             Commands.AnnotationMaker.NewAnnotationFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(NewAnnotationFinished_Executed);
+            Commands.BookTimeLine.LeftClickOnElement.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(LeftClickOnElement_Executed);
+        }
+
+        void LeftClickOnElement_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+        {
+            TimeSpan TimeToGo = (TimeSpan)e.Parameter;
+            PolemicElementVM ClickedElement = (PolemicElementVM)e.Source;
+            if(ConsultationBookViewContextMenu.SelectedBook == ClickedElement.Chapter.Book)
+            {
+                ConsultationBookViewContextMenu.ActualVideoSourceVM.GoTo(TimeToGo);
+            }
         }
 
         void NewAnnotationFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/FranceInterENMI29.ldt	Wed Feb 10 14:09:58 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/FranceInterENMI29.ldt	Wed Feb 10 14:56:46 2010 +0100
@@ -4,12 +4,12 @@
     <media id="" src="/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.iri" video="" pict="" extra="" />
   </medias>
   <annotations>
-    <content id="28c161b4-de03-4a04-9d12-7a08bbdb99f1" title="" author="" abstract="">
-      <decoupage id="4adb0979-4bd2-417f-aa80-65cf1aa7649d" author="TestUser">
+    <content id="b493430f-1ef0-47c6-8106-fa41df22674f" title="" author="" abstract="">
+      <decoupage id="3fa7c4d1-0ca2-4d41-bdff-0c2db9bd8bb1" author="TestUser">
         <title>Emission France Culture</title>
         <abstract></abstract>
         <elements>
-          <element id="1b0e6e2f-3ea4-4b01-9639-ca16a1386cde" begin="0" dur="636088" author="TestUser" date="10/02/2010 14:07:49" color="0" src="">
+          <element id="1b0e6e2f-3ea4-4b01-9639-ca16a1386cde" begin="0" dur="636088" author="TestUser" date="10/02/2010 14:43:58" color="0" src="">
             <title>A</title>
             <abstract>A</abstract>
             <audio></audio>
@@ -20,11 +20,11 @@
           </element>
         </elements>
       </decoupage>
-      <decoupage id="a2def39f-789f-48f2-9e9b-d29ffab3190e" author="TestUser">
+      <decoupage id="4e1bf10e-320d-428d-8465-9cf084e4b9d6" author="TestUser">
         <title>Emission France Culture</title>
         <abstract></abstract>
         <elements>
-          <element id="537b7d83-ba91-456c-b36d-95cd6c022a9a" begin="0" dur="636088" author="TestUser" date="10/02/2010 14:07:49" color="0" src="">
+          <element id="537b7d83-ba91-456c-b36d-95cd6c022a9a" begin="0" dur="636088" author="TestUser" date="10/02/2010 14:43:58" color="0" src="">
             <title>B</title>
             <abstract>B</abstract>
             <audio></audio>
@@ -35,6 +35,51 @@
           </element>
         </elements>
       </decoupage>
+      <decoupage id="67bf2701-b74c-476e-b0bd-586e2df84c10" author="TestUser">
+        <title>Emission France Culture</title>
+        <abstract></abstract>
+        <elements>
+          <element id="da8b4bf7-9007-448e-9549-1812755a8277" begin="847179" dur="0" author="TestUser" date="10/02/2010 14:43:58" color="0" src="">
+            <title>aa</title>
+            <abstract>aaa</abstract>
+            <audio></audio>
+            <video></video>
+            <tags>
+              <tag>aa</tag>
+            </tags>
+          </element>
+        </elements>
+      </decoupage>
+      <decoupage id="8f119fa3-283d-4586-8224-0cb76235502a" author="TestUser">
+        <title>Emission France Culture</title>
+        <abstract></abstract>
+        <elements>
+          <element id="8e5c1014-8663-4dac-9ea9-5ff2b03694fa" begin="847179" dur="227432" author="TestUser" date="10/02/2010 14:43:58" color="0" src="">
+            <title></title>
+            <abstract></abstract>
+            <audio></audio>
+            <video></video>
+            <tags>
+              <tag></tag>
+            </tags>
+          </element>
+        </elements>
+      </decoupage>
+      <decoupage id="c630e9d7-f641-48e0-aee5-fb903bc24baa" author="TestUser">
+        <title>Emission France Culture</title>
+        <abstract></abstract>
+        <elements>
+          <element id="b6ccb96b-cd33-4a88-a510-c7dd71567952" begin="1400796" dur="53494" author="TestUser" date="10/02/2010 14:43:58" color="0" src="">
+            <title>aa</title>
+            <abstract>aaa</abstract>
+            <audio></audio>
+            <video></video>
+            <tags>
+              <tag>aaa</tag>
+            </tags>
+          </element>
+        </elements>
+      </decoupage>
     </content>
   </annotations>
   <displays />
@@ -42,6 +87,9 @@
   <basicRelations>
     <relation idElementFrom="s_92506216-25D0-6E9F-A10B-748EAAFA09B9" idElementTo="1b0e6e2f-3ea4-4b01-9639-ca16a1386cde" title="A" type="Polémique" />
     <relation idElementFrom="s_92506216-25D0-6E9F-A10B-748EAAFA09B9" idElementTo="537b7d83-ba91-456c-b36d-95cd6c022a9a" title="B" type="Adhésion" />
+    <relation idElementFrom="s_F47370B1-C509-1630-A07B-748EAB0156D8" idElementTo="da8b4bf7-9007-448e-9549-1812755a8277" title="aa" type="Question" />
+    <relation idElementFrom="s_F47370B1-C509-1630-A07B-748EAB0156D8" idElementTo="8e5c1014-8663-4dac-9ea9-5ff2b03694fa" title="" type="Question" />
+    <relation idElementFrom="s_2B140B79-08CF-221B-9692-748EAB0CACFA" idElementTo="b6ccb96b-cd33-4a88-a510-c7dd71567952" title="aa" type="Polémique" />
   </basicRelations>
   <polemicRelations />
 </iri>
\ No newline at end of file