# HG changeset patch # User PAMPHILE Jonathan # Date 1255455193 -7200 # Node ID 9f157d9c725b7a9c6d44d8cd91a82a470472aa3c # Parent 3d66ca73df55250ccfab5e9fe502efebbb6df2ab MVVM diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance.ActionFactory/ActionFactory.cs --- a/src/FingersDance.ActionFactory/ActionFactory.cs Tue Oct 13 19:09:46 2009 +0200 +++ b/src/FingersDance.ActionFactory/ActionFactory.cs Tue Oct 13 19:33:13 2009 +0200 @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FingersDance.Control.Player; namespace FingersDance.ActionFactory { diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance.ActionFactory/ActionGenerator.cs --- a/src/FingersDance.ActionFactory/ActionGenerator.cs Tue Oct 13 19:09:46 2009 +0200 +++ b/src/FingersDance.ActionFactory/ActionGenerator.cs Tue Oct 13 19:33:13 2009 +0200 @@ -17,6 +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("ActionAddAnnotation", typeof(FingersDance.Actions.ActionAddAnnotation)); } diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance.ActionFactory/FingersDance.ActionFactory.csproj --- a/src/FingersDance.ActionFactory/FingersDance.ActionFactory.csproj Tue Oct 13 19:09:46 2009 +0200 +++ b/src/FingersDance.ActionFactory/FingersDance.ActionFactory.csproj Tue Oct 13 19:33:13 2009 +0200 @@ -3,7 +3,7 @@ Debug AnyCPU - 9.0.21022 + 9.0.30729 2.0 {C7B905EA-0678-4DA0-8EF8-7F9CBD22818E} Library @@ -30,6 +30,26 @@ prompt 4 + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + @@ -54,10 +74,6 @@ {1E80D5A1-C45C-443B-8992-4A4D78D280FC} FingersDance.Actions - - {D5625AA4-362F-4E46-9916-65F3B173ECBE} - FingersDance.Control.Player - + + + + - + + + - + diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance.Views/TimelineView.xaml.cs --- a/src/FingersDance.Views/TimelineView.xaml.cs Tue Oct 13 19:09:46 2009 +0200 +++ b/src/FingersDance.Views/TimelineView.xaml.cs Tue Oct 13 19:33:13 2009 +0200 @@ -6,12 +6,15 @@ 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.Navigation; using System.Windows.Shapes; +using FingersDance.Data; +using FingersDance.ViewModels; +using FingersDance.Views; + namespace FingersDance.Views { /// @@ -19,9 +22,15 @@ /// public partial class TimelineView : UserControl { + + private Boolean hasDragCanceledHandler = false; + public TimelineView() { InitializeComponent(); } + + + } } diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance/FingersDance.csproj --- a/src/FingersDance/FingersDance.csproj Tue Oct 13 19:09:46 2009 +0200 +++ b/src/FingersDance/FingersDance.csproj Tue Oct 13 19:33:13 2009 +0200 @@ -134,8 +134,15 @@ Always - - + + Always + + + Always + + + Always + @@ -152,6 +159,10 @@ {C7B905EA-0678-4DA0-8EF8-7F9CBD22818E} FingersDance.ActionFactory + + {D579FDB5-D412-4797-A0FF-C5873AE08BB8} + FingersDance.Control.Close + {6960F7ED-3D82-4BCE-AB88-D31D6C72F2B6} FingersDance.Control.Menu @@ -172,6 +183,14 @@ {E6A3A067-1CB4-43D2-BB9C-DC72361F7E22} FingersDance.Control.UserPanel + + {EAF384DB-2AE4-4132-839D-60F9DAFDEAD8} + FingersDance.Data + + + {E81BB080-0598-43AC-90CE-54D6570C4E9E} + FingersDance.ViewModels + diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance/MainSurfaceWindow.xaml --- a/src/FingersDance/MainSurfaceWindow.xaml Tue Oct 13 19:09:46 2009 +0200 +++ b/src/FingersDance/MainSurfaceWindow.xaml Tue Oct 13 19:33:13 2009 +0200 @@ -16,7 +16,7 @@ x:Class="FingersDance.SurfaceWindow1" Title="FingersDance" Width="1024" Height="768" x:Name="mainSurfaceWindow" - Background="{x:Null}" + Background="{x:Null}" Loaded="mainSurfaceWindow_Loaded" > @@ -125,6 +125,9 @@ + + + @@ -145,7 +148,7 @@ - + @@ -157,7 +160,7 @@ - + @@ -168,12 +171,12 @@ - + - + diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Tue Oct 13 19:09:46 2009 +0200 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Tue Oct 13 19:33:13 2009 +0200 @@ -17,6 +17,9 @@ using FingersDance.Control.UserPanel; using FingersDance.Control.Screen; +using FingersDance.Control.Close; +using FingersDance.ViewModels; +using FingersDance.Data; namespace FingersDance @@ -31,14 +34,18 @@ /// /// #region Variables + private UserControlUserPanel Panel1 = null; private UserControlUserPanel Panel2 = null; private UserControlUserPanel Panel3 = null; private UserControlUserPanel Panel4 = null; + ActionFactory.ActionGenerator _Factory = new FingersDance.ActionFactory.ActionFactory().GetGenerator(); + private MainViewModel _mainviewmodel = new MainViewModel(); + #endregion - ActionFactory.ActionGenerator _Factory = new FingersDance.ActionFactory.ActionFactory().GetGenerator(); + #region Constructor public SurfaceWindow1() { InitializeComponent(); @@ -50,6 +57,9 @@ // Add handlers for Application activation events AddActivationHandlers(); } + #endregion + + #region Initialization private void InitPivotInertia() { @@ -82,6 +92,7 @@ catch (Exception ex) { } } + #endregion /// /// Occurs when the window is about to close. @@ -125,6 +136,7 @@ private void OnApplicationActivated(object sender, EventArgs e) { //TODO: enable audio, animations here + } /// @@ -149,6 +161,29 @@ //TODO: disable audio, animations here } + /// + /// This is called when application has been loaded, we change the orientation + /// of the application + /// + /// + /// + private void mainSurfaceWindow_Loaded(object sender, RoutedEventArgs e) + { + + if (ApplicationLauncher.InitialOrientation == UserOrientation.Top) + { + // Rotate the main canvas by 180 degrees. + this.MainGrid.LayoutTransform = new RotateTransform(180.0); + } + else + { + // Remove the rotate transform on the main canvas. + this.MainGrid.LayoutTransform = null; + } + // Dismiss the loading screen. + ApplicationLauncher.SignalApplicationLoadComplete(); + } + private void scaterview_ContactChanged(object sender, ContactEventArgs e) { } @@ -228,13 +263,18 @@ private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e) { + // Si aucune video n'a été sélectionnée et qu'une grid contient un élément (listvideo), on ne fait rien + if (_mainviewmodel.Session.VideoPath.Equals("") && (Grid1.Children.Count == 2 || Grid2.Children.Count == 2 || Grid3.Children.Count == 2 || Grid4.Children.Count == 2)) + return; + + // Traitement du contact down sur le pivot (Création d'un screen ou suppression d'un panel switch ((int)sender) { case 1: - if (Panel1 == null) + if (Panel1 == null && Grid1.Children.Count == 1) { //1-Creation du control Screen - UserControlScreen Screen = new UserControlScreen(1); + UserControlScreen Screen = new UserControlScreen(1, _mainviewmodel); Screen.Name = "Screen1"; Screen.contexteGrid = Grid1.Name.ToString(); //2-Rajout du screen dans la grid correspondante @@ -242,12 +282,22 @@ Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); } + else //Affichage du message de confirmation + { + if (Panel1 != null && Grid1.Children.Count == 2) + { + UserControlClose UCclose = new UserControlClose(1); + UCclose.Name = "CloseAlert1"; + Grid1.Children.Add(UCclose); + UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + } + } break; case 2: - if (Panel2 == null) + if (Panel2 == null && Grid2.Children.Count == 1) { //1-Creation du control Screen - UserControlScreen Screen = new UserControlScreen(2); + UserControlScreen Screen = new UserControlScreen(2, _mainviewmodel); Screen.Name = "Screen2"; Screen.contexteGrid = Grid2.Name.ToString(); //2-Rajout du screen dans la grid correspondante @@ -255,12 +305,22 @@ Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); } + else //Affichage du message de confirmation + { + if (Panel2 != null && Grid2.Children.Count == 2) + { + UserControlClose UCclose = new UserControlClose(2); + UCclose.Name = "CloseAlert2"; + Grid2.Children.Add(UCclose); + UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + } + } break; case 3: - if (Panel3 == null) + if (Panel3 == null && Grid3.Children.Count == 1) { //1-Creation du control Screen - UserControlScreen Screen = new UserControlScreen(3); + UserControlScreen Screen = new UserControlScreen(3, _mainviewmodel); Screen.Name = "Screen3"; Screen.contexteGrid = Grid3.Name.ToString(); //2-Rajout du screen dans la grid correspondante @@ -268,12 +328,22 @@ Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); } + else //Affichage du message de confirmation + { + if (Panel3 != null && Grid3.Children.Count == 2) + { + UserControlClose UCclose = new UserControlClose(3); + UCclose.Name = "CloseAlert3"; + Grid3.Children.Add(UCclose); + UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + } + } break; case 4: - if (Panel4 == null) + if (Panel4 == null && Grid4.Children.Count == 1) { //1-Creation du control Screen - UserControlScreen Screen = new UserControlScreen(4); + UserControlScreen Screen = new UserControlScreen(4, _mainviewmodel); Screen.Name = "Screen4"; Screen.contexteGrid = Grid4.Name.ToString(); //2-Rajout du screen dans la grid correspondante @@ -281,6 +351,16 @@ Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); } + else //Affichage du message de confirmation + { + if (Panel4 != null && Grid4.Children.Count == 2) + { + UserControlClose UCclose = new UserControlClose(4); + UCclose.Name = "CloseAlert4"; + Grid4.Children.Add(UCclose); + UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); + } + } break; } @@ -295,28 +375,33 @@ Grid root = (Grid)(((UserControlScreen)sender).Parent); root.Children.Remove(((UserControlScreen)sender)); //2-Creation du User Panel + Project newProject = _mainviewmodel.CreateProject(((UserControlScreen)sender).User); + + if ((Panel1 != null && Panel1.Project.Equals(newProject)) || (Panel2 != null && Panel2.Project.Equals(newProject)) || (Panel3 != null && Panel3.Project.Equals(newProject)) || (Panel4 != null && Panel4.Project.Equals(newProject))) + return; + switch (((UserControlScreen)sender).id) { case 1: - Panel1 = new UserControlUserPanel(((UserControlScreen)sender).Path); + Panel1 = new UserControlUserPanel(newProject, _mainviewmodel.Session.VideoPath); Panel1.Name = "UserPanel1"; //3-Rajout sur la Grid Root root.Children.Add(Panel1); break; case 2: - Panel2 = new UserControlUserPanel(((UserControlScreen)sender).Path); + Panel2 = new UserControlUserPanel(newProject, _mainviewmodel.Session.VideoPath); Panel2.Name = "UserPanel2"; //3-Rajout sur la Grid Root root.Children.Add(Panel2); break; case 3: - Panel3 = new UserControlUserPanel(((UserControlScreen)sender).Path); + Panel3 = new UserControlUserPanel(newProject, _mainviewmodel.Session.VideoPath); Panel3.Name = "UserPanel3"; //3-Rajout sur la Grid Root root.Children.Add(Panel3); break; case 4: - Panel4 = new UserControlUserPanel(((UserControlScreen)sender).Path); + Panel4 = new UserControlUserPanel(newProject, _mainviewmodel.Session.VideoPath); Panel4.Name = "UserPanel4"; //3-Rajout sur la Grid Root root.Children.Add(Panel4); @@ -326,7 +411,38 @@ catch (Exception ex) { } } + //Actions du boutton Alert selon l'action close OK ou NON + private void CloseAlert_EH_SurfaceButton_ContactDown(object sender, EventArgs e) + { + Grid root = (Grid)(((UserControlClose)sender).Parent); + if(((UserControlClose) sender).close) + { + switch(((UserControlClose)sender).Id) + { + case 1: + root.Children.Remove(Panel1); + Panel1 = null; + break; + case 2: + root.Children.Remove(Panel2); + Panel2 = null; + break; + case 3: + root.Children.Remove(Panel3); + Panel3 = null; + break; + case 4: + root.Children.Remove(Panel4); + Panel4 = null; + break; + } + } + 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(); + } } } \ No newline at end of file diff -r 3d66ca73df55 -r 9f157d9c725b src/FingersDance/Resources/videos.xml --- a/src/FingersDance/Resources/videos.xml Tue Oct 13 19:09:46 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - - Butterfly - C:\Users\Public\Public Dev\fingersdance\src\FingersDance\Resources\Butterfly.wmv - C:\Users\Public\Public Dev\fingersdance\src\FingersDance\Resources\Butterfly.jpg - - - Lake - C:\Users\Public\Public Dev\fingersdance\src\FingersDance\Resources\Lake.wmv - C:\Users\Public\Public Dev\fingersdance\src\FingersDance\Resources\Lake.jpg - - - One Flat Thing - C:\Users\Public\Public Dev\fingersdance\src\FingersDance\Resources\oneflat.wmv - C:\Users\Public\Public Dev\fingersdance\src\FingersDance\Resources\oneflat.png - - \ No newline at end of file