src/FingersDance/MainSurfaceWindow.xaml.cs
changeset 182 25b49d4f1635
parent 168 d70ee2002f75
child 186 83615722dbab
--- a/src/FingersDance/MainSurfaceWindow.xaml.cs	Wed Oct 28 13:46:38 2009 +0100
+++ b/src/FingersDance/MainSurfaceWindow.xaml.cs	Wed Oct 28 17:07:27 2009 +0100
@@ -291,7 +291,7 @@
         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.Name.Equals("") && (Grid1.Children.Count == 2 || Grid2.Children.Count == 2 || Grid3.Children.Count == 2 || Grid4.Children.Count == 2))
+            if (_mainviewmodel.Project.Name.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
@@ -307,7 +307,7 @@
                         //2-Rajout du screen dans la grid correspondante
                         Grid1.Children.Add(Screen);
 
-                        Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
+                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
                     }
                     else //Affichage du message de confirmation
                     {
@@ -330,7 +330,7 @@
                         //2-Rajout du screen dans la grid correspondante
                         Grid2.Children.Add(Screen);
 
-                        Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
+                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
                     }
                     else //Affichage du message de confirmation
                     {
@@ -353,7 +353,7 @@
                         //2-Rajout du screen dans la grid correspondante
                         Grid3.Children.Add(Screen);
 
-                        Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
+                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
                     }
                     else //Affichage du message de confirmation
                     {
@@ -376,7 +376,7 @@
                         //2-Rajout du screen dans la grid correspondante
                         Grid4.Children.Add(Screen);
 
-                        Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
+                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
                     }
                     else //Affichage du message de confirmation
                     {
@@ -405,12 +405,12 @@
                 Grid root = (Grid)(((UserControlScreen)sender).Parent);
                 root.Children.Remove(((UserControlScreen)sender));
 
-                if (((UserControlScreen)sender).Project != null)
+                if (((UserControlScreen)sender).Cutting != null)
                 {
                     //2-Creation du User Panel
-                    Project newProject = ((UserControlScreen)sender).Project.Project;
+                    CuttingViewModel newCuttingVM = ((UserControlScreen)sender).Cutting;
 
-                    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)))
+                    if ((Panel1 != null && Panel1.CuttingVM.Equals(newCuttingVM)) || (Panel2 != null && Panel2.CuttingVM.Equals(newCuttingVM)) || (Panel3 != null && Panel3.CuttingVM.Equals(newCuttingVM)) || (Panel4 != null && Panel4.CuttingVM.Equals(newCuttingVM)))
                         return;
 
                     Random c = new Random();
@@ -419,7 +419,7 @@
                     {
                         case 1:
                             UserControlPivot.ApplyColor(1, color);
-                            Panel1 = new UserControlUserPanel(1, (new ColorFactory()).Colors[color], newProject, _mainviewmodel.Session.VideoPath);
+                            Panel1 = new UserControlUserPanel(1, (new ColorFactory()).Colors[color], newCuttingVM.Cutting, _mainviewmodel.Project.VideoPath);
                             Panel1.Name = "UserPanel1";
                             Panel1.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
                             Panel1.idcolor = color;
@@ -428,7 +428,7 @@
                             break;
                         case 2:
                             UserControlPivot.ApplyColor(2, color);
-                            Panel2 = new UserControlUserPanel(2, (new ColorFactory()).Colors[color], newProject, _mainviewmodel.Session.VideoPath);
+                            Panel2 = new UserControlUserPanel(2, (new ColorFactory()).Colors[color], newCuttingVM.Cutting, _mainviewmodel.Project.VideoPath);
                             Panel2.Name = "UserPanel2";
                             Panel2.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
                             Panel2.idcolor = color;
@@ -437,7 +437,7 @@
                             break;
                         case 3:
                             UserControlPivot.ApplyColor(3, color);
-                            Panel3 = new UserControlUserPanel(3, (new ColorFactory()).Colors[color], newProject, _mainviewmodel.Session.VideoPath);
+                            Panel3 = new UserControlUserPanel(3, (new ColorFactory()).Colors[color], newCuttingVM.Cutting, _mainviewmodel.Project.VideoPath);
                             Panel3.Name = "UserPanel3";
                             Panel3.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
                             Panel3.idcolor = color;
@@ -446,7 +446,7 @@
                             break;
                         case 4:
                             UserControlPivot.ApplyColor(4, color);
-                            Panel4 = new UserControlUserPanel(4, (new ColorFactory()).Colors[color], newProject, _mainviewmodel.Session.VideoPath);
+                            Panel4 = new UserControlUserPanel(4, (new ColorFactory()).Colors[color], newCuttingVM.Cutting, _mainviewmodel.Project.VideoPath);
                             Panel4.Name = "UserPanel4";
                             Panel4.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
                             Panel4.idcolor = color;
@@ -491,7 +491,7 @@
             }
             root.Children.Remove(((UserControlClose)sender));
             if (Panel1 == null && Panel2 == null && Panel3 == null && Panel4 == null)
-                _mainviewmodel.CloseSession();
+                _mainviewmodel.CloseProject();
         }