# HG changeset patch # User PAMPHILE Jonathan # Date 1255520665 -7200 # Node ID dd8ed4d3beb639b45abdae1aaea770b828f11791 # Parent 42cf4dbc473b5665137262a3472f5a7e871c8ff0# Parent 843f65b412908ac206bde7d161d5d385be503594 Merge diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.ActionFactory/ActionGenerator.cs --- a/src/FingersDance.ActionFactory/ActionGenerator.cs Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.ActionFactory/ActionGenerator.cs Wed Oct 14 13:44:25 2009 +0200 @@ -17,7 +17,7 @@ actionDict.Add("ActionOpenMedia", typeof(FingersDance.Actions.ActionOpenMedia)); actionDict.Add("ActionStopMedia", typeof(FingersDance.Actions.ActionStopMedia)); - //actionDict.Add("ActionStartOrEndAnnotation", typeof(FingersDance.Actions.ActionStartOrEndAnnotation)); + actionDict.Add("ActionStartOrEndAnnotation", typeof(FingersDance.Actions.ActionStartOrEndAnnotation)); actionDict.Add("ActionAddAnnotation", typeof(FingersDance.Actions.ActionAddAnnotation)); } diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.ActionFactory/FingersDance.ActionFactory.csproj diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Actions/ActionStartOrEndAnnotation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Actions/ActionStartOrEndAnnotation.cs Wed Oct 14 13:44:25 2009 +0200 @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using FingersDance.Control.TimeLine; + +namespace FingersDance.Actions +{ + public class ActionStartOrEndAnnotation : FingersDance.Actions.ActionBase + { + + private string _Text = ""; + private UserControlTimeLine myTimeline; + + public ActionStartOrEndAnnotation() + { + + } + + public ActionStartOrEndAnnotation(string text) + { + _Text = text; + } + + public ActionStartOrEndAnnotation(UserControlTimeLine uct) + { + myTimeline = uct; + } + + public void Execute() + { + if (myTimeline != null) + myTimeline.startOrEndAnnotation(); + } + } +} + diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Actions/FingersDance.Actions.csproj --- a/src/FingersDance.Actions/FingersDance.Actions.csproj Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.Actions/FingersDance.Actions.csproj Wed Oct 14 13:44:25 2009 +0200 @@ -82,6 +82,7 @@ + diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Control.Close/FingersDance.Control.Close.csproj --- a/src/FingersDance.Control.Close/FingersDance.Control.Close.csproj Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.Control.Close/FingersDance.Control.Close.csproj Wed Oct 14 13:44:25 2009 +0200 @@ -104,9 +104,6 @@ True Settings.settings - - SurfaceWindow1.xaml - @@ -121,11 +118,5 @@ - - - MSBuild:Compile - Designer - - \ No newline at end of file diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Control.Close/SurfaceWindow1.xaml --- a/src/FingersDance.Control.Close/SurfaceWindow1.xaml Tue Oct 13 19:36:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Control.Close/SurfaceWindow1.xaml.cs --- a/src/FingersDance.Control.Close/SurfaceWindow1.xaml.cs Tue Oct 13 19:36:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Windows.Threading; -using Microsoft.Surface; -using Microsoft.Surface.Presentation; -using Microsoft.Surface.Presentation.Controls; - -namespace FingersDance.Control.Close -{ - /// - /// Interaction logic for SurfaceWindow1.xaml - /// - public partial class SurfaceWindow1 : SurfaceWindow - { - /// - /// Default constructor. - /// - public SurfaceWindow1() - { - InitializeComponent(); - - // Add handlers for Application activation events - AddActivationHandlers(); - } - - - /// - /// Occurs when the window is about to close. - /// - /// - protected override void OnClosed(EventArgs e) - { - base.OnClosed(e); - - // Remove handlers for Application activation events - RemoveActivationHandlers(); - } - - /// - /// Adds handlers for Application activation events. - /// - private void AddActivationHandlers() - { - // Subscribe to surface application activation events - ApplicationLauncher.ApplicationActivated += OnApplicationActivated; - ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed; - ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated; - } - - /// - /// Removes handlers for Application activation events. - /// - private void RemoveActivationHandlers() - { - // Unsubscribe from surface application activation events - ApplicationLauncher.ApplicationActivated -= OnApplicationActivated; - ApplicationLauncher.ApplicationPreviewed -= OnApplicationPreviewed; - ApplicationLauncher.ApplicationDeactivated -= OnApplicationDeactivated; - } - - /// - /// This is called when application has been activated. - /// - /// - /// - private void OnApplicationActivated(object sender, EventArgs e) - { - //TODO: enable audio, animations here - } - - /// - /// This is called when application is in preview mode. - /// - /// - /// - private void OnApplicationPreviewed(object sender, EventArgs e) - { - //TODO: Disable audio here if it is enabled - - //TODO: optionally enable animations here - } - - /// - /// This is called when application has been deactivated. - /// - /// - /// - private void OnApplicationDeactivated(object sender, EventArgs e) - { - //TODO: disable audio, animations here - } - } -} \ No newline at end of file diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Control.Close/UserControlClose.xaml --- a/src/FingersDance.Control.Close/UserControlClose.xaml Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.Control.Close/UserControlClose.xaml Wed Oct 14 13:44:25 2009 +0200 @@ -5,12 +5,16 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="FingersDance.Control.Close.UserControlClose" - x:Name="UserControl" - Width="359.284" Height="210.955" xmlns:Custom="http://schemas.microsoft.com/surface/2008" BorderBrush="White"> - - - + + {D579FDB5-D412-4797-A0FF-C5873AE08BB8} + FingersDance.Control.Close + {EAF384DB-2AE4-4132-839D-60F9DAFDEAD8} FingersDance.Data @@ -138,5 +141,8 @@ FingersDance.Views + + + \ No newline at end of file diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml --- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml Wed Oct 14 13:44:25 2009 +0200 @@ -5,781 +5,783 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:vw="clr-namespace:FingersDance.Views;assembly=FingersDance.Views" + xmlns:popup="clr-namespace:FingersDance.Control.Close;assembly=FingersDance.Control.Close" xmlns:Custom="http://schemas.microsoft.com/surface/2008" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic" x:Class="FingersDance.Control.TimeLine.UserControlTimeLine" x:Name="UserControl" d:DesignWidth="383" Background="{x:Null}" d:DesignHeight="33"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + \ No newline at end of file diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs --- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Wed Oct 14 13:44:25 2009 +0200 @@ -10,13 +10,14 @@ using System.Windows.Media.Animation; using System.Windows.Navigation; using System.Windows.Controls.Primitives; +using Microsoft.Surface.Presentation; using Microsoft.Surface.Presentation.Controls; -using Microsoft.Surface.Presentation; using System.Windows.Threading; using FingersDance.Data; using FingersDance.ViewModels; using FingersDance.Views; +using FingersDance.Control.Close; namespace FingersDance.Control.TimeLine { @@ -28,7 +29,7 @@ private bool isDragging = false; private bool finishedDragging = false; #endregion - + public event EventHandler DragStarted; public event EventHandler DragCompleted; public event EventHandler TimerTick; @@ -41,6 +42,8 @@ private Boolean AnnotWaiting = false; private float AnnotTcBegin; + private AnnotationViewModel canceledAnnotationVM; + #region Properties public SurfaceSlider Slider @@ -98,7 +101,7 @@ public UserControlTimeLine() { this.InitializeComponent(); - + // Insert code required on object creation below this point. } @@ -402,27 +405,41 @@ private void onDragCanceled(Object sender, SurfaceDragDropEventArgs e) { Console.WriteLine("onDragCanceled = " + sender + ", ((ContentControl)e.Cursor.Visual).Content = " + ((ContentControl)e.Cursor.Visual).Content); - // e.Cursor.Visual is the ContentControl, so its Content is the dragged TimelineAnnotationView - AnnotationViewModel annotationDataVM = (AnnotationViewModel)((TimelineAnnotationView)((ContentControl)e.Cursor.Visual).Content).DataContext; // We check if the annotation is well one of the current annotations if (CuttingVM != null) { + // e.Cursor.Visual is the ContentControl, so its Content is the dragged TimelineAnnotationView + canceledAnnotationVM = (AnnotationViewModel)((TimelineAnnotationView)((ContentControl)e.Cursor.Visual).Content).DataContext; + confirmCancelPopup.Visibility = Visibility.Visible; + } + } + + private void confirmCancelPopup_ConfirmYesOrNo(object sender, ConfirmEventArgs e) + { + //Consolenfirm = " + e.Confirmed); + // We check if the annotation is well one of the current annotations + if (CuttingVM != null && canceledAnnotationVM != null && e.Confirmed == true) + { foreach (Annotation a in AnnotList) { - //Console.WriteLine("a.TcBegin = " + a.TcBegin + ", avm.TcBegin = " + avm.TcBegin + ", tcOut = " + (a.TcBegin + a.Dur)); - // Check begin TC - if (a.TcBegin == annotationDataVM.TcBegin && a.Dur == annotationDataVM.Dur && a.GestureType==annotationDataVM.GestureType) + // Check begin TcBegin, duration and gesture type + if (a.TcBegin == canceledAnnotationVM.TcBegin && a.Dur == canceledAnnotationVM.Dur && a.GestureType == canceledAnnotationVM.GestureType) { - // We found the good annotation so we can delete it + // We found the good annotation so we can remove it AnnotList.Remove(a); // We redisplay the timeline CuttingVM.setListFromAnnotations(AnnotList, AnnotWidth); tv.DataContext = null; tv.DataContext = CuttingVM; + // We close the popup and return as soon as we removed the annotation to avoid an error on AnnotList, which is just modified + confirmCancelPopup.Visibility = Visibility.Hidden; + canceledAnnotationVM = null; return; } } } + confirmCancelPopup.Visibility = Visibility.Hidden; + canceledAnnotationVM = null; } diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs --- a/src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs Wed Oct 14 13:44:25 2009 +0200 @@ -13,7 +13,7 @@ { public partial class UserControlUserPanel { - // public int id = 0; + public int id = 0; Project _Project = new Project(); public Project Project diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Data/FingersDance.Data.csproj diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.ViewModel/AnnotationViewModel.cs diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.ViewModel/CuttingViewModel.cs diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.ViewModel/FingersDance.ViewModels.csproj diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Views/FingersDance.Views.csproj diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Views/TimelineAnnotationView.xaml diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Views/TimelineAnnotationView.xaml.cs diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Views/TimelineView.xaml diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance.Views/TimelineView.xaml.cs --- a/src/FingersDance.Views/TimelineView.xaml.cs Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance.Views/TimelineView.xaml.cs Wed Oct 14 13:44:25 2009 +0200 @@ -25,6 +25,7 @@ private Boolean hasDragCanceledHandler = false; + public TimelineView() { InitializeComponent(); diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance/FingersDance.csproj --- a/src/FingersDance/FingersDance.csproj Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance/FingersDance.csproj Wed Oct 14 13:44:25 2009 +0200 @@ -163,6 +163,10 @@ {D579FDB5-D412-4797-A0FF-C5873AE08BB8} FingersDance.Control.Close + + {D579FDB5-D412-4797-A0FF-C5873AE08BB8} + FingersDance.Control.Close + {6960F7ED-3D82-4BCE-AB88-D31D6C72F2B6} FingersDance.Control.Menu diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance/MainSurfaceWindow.xaml diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Wed Oct 14 13:44:25 2009 +0200 @@ -286,10 +286,10 @@ { if (Panel1 != null && Grid1.Children.Count == 2) { - UserControlClose UCclose = new UserControlClose(1); + UserControlClose UCclose = new UserControlClose(1, "Êtes-vous sûr de vouloir quitter ?"); UCclose.Name = "CloseAlert1"; Grid1.Children.Add(UCclose); - UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + UCclose.ConfirmYesOrNo += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); } } break; @@ -309,10 +309,10 @@ { if (Panel2 != null && Grid2.Children.Count == 2) { - UserControlClose UCclose = new UserControlClose(2); + UserControlClose UCclose = new UserControlClose(2, "Êtes-vous sûr de vouloir quitter ?"); UCclose.Name = "CloseAlert2"; Grid2.Children.Add(UCclose); - UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + UCclose.ConfirmYesOrNo += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); } } break; @@ -332,10 +332,10 @@ { if (Panel3 != null && Grid3.Children.Count == 2) { - UserControlClose UCclose = new UserControlClose(3); + UserControlClose UCclose = new UserControlClose(3, "Êtes-vous sûr de vouloir quitter ?"); UCclose.Name = "CloseAlert3"; Grid3.Children.Add(UCclose); - UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + UCclose.ConfirmYesOrNo += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); } } break; @@ -355,10 +355,10 @@ { if (Panel4 != null && Grid4.Children.Count == 2) { - UserControlClose UCclose = new UserControlClose(4); + UserControlClose UCclose = new UserControlClose(4, "Êtes-vous sûr de vouloir quitter ?"); UCclose.Name = "CloseAlert4"; Grid4.Children.Add(UCclose); - UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + UCclose.ConfirmYesOrNo += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); } } break; @@ -412,12 +412,12 @@ } //Actions du boutton Alert selon l'action close OK ou NON - private void CloseAlert_EH_SurfaceButton_ContactDown(object sender, EventArgs e) + private void CloseAlert_EH_SurfaceButton_ContactDown(object sender, ConfirmEventArgs e) { Grid root = (Grid)(((UserControlClose)sender).Parent); - if(((UserControlClose) sender).close) + if(e.Confirmed==true) { - switch(((UserControlClose)sender).Id) + switch(e.PanelNumber) { case 1: root.Children.Remove(Panel1); @@ -438,10 +438,6 @@ } } root.Children.Remove(((UserControlClose)sender)); - - // S'il ne reste aucun panel d'ouvert, on ferme la session - if (Panel1 == null && Panel2 == null && Panel3 == null && Panel4 == null) - _mainviewmodel.CloseSession(); } } diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance/Resources/menu.xml --- a/src/FingersDance/Resources/menu.xml Tue Oct 13 19:36:04 2009 +0200 +++ b/src/FingersDance/Resources/menu.xml Wed Oct 14 13:44:25 2009 +0200 @@ -68,13 +68,13 @@ Saut 1 FingersDanceAnnotationButtonNiveau3 - ActionAddAnnotation + ActionStartOrEndAnnotation Pirouette 2 FingersDanceAnnotationButtonNiveau3 - ActionAddAnnotation + ActionStartOrEndAnnotation FingersDanceAnnotationButtonNiveau2 diff -r 843f65b41290 -r dd8ed4d3beb6 src/FingersDance/Resources/videos.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance/Resources/videos.xml Wed Oct 14 13:44:25 2009 +0200 @@ -0,0 +1,18 @@ + + + + Butterfly + C:\Users\santiago\Desktop\MercurialSurfaceFingerDance\src\FingersDance\bin\Debug\Resources\Butterfly.wmv + C:\Users\santiago\Desktop\MercurialSurfaceFingerDance\src\FingersDance\bin\Debug\Resources\Butterfly.jpg + + + Lake + C:\Users\santiago\Desktop\MercurialSurfaceFingerDance\src\FingersDance\bin\Debug\Resources\Lake.wmv + C:\Users\santiago\Desktop\MercurialSurfaceFingerDance\src\FingersDance\bin\Debug\Resources\Lake.jpg + + + One Flat Thing + C:\Users\santiago\Desktop\MercurialSurfaceFingerDance\src\FingersDance\bin\Debug\Resources\oneflat.wmv + C:\Users\santiago\Desktop\MercurialSurfaceFingerDance\src\FingersDance\bin\Debug\Resources\oneflat.png + + \ No newline at end of file