author | cavaliet |
Wed, 28 Oct 2009 17:07:27 +0100 | |
changeset 182 | 25b49d4f1635 |
parent 156 | e16c8c913c65 |
child 186 | 83615722dbab |
permissions | -rw-r--r-- |
35 | 1 |
using System; |
2 |
using System.IO; |
|
3 |
using System.Net; |
|
148 | 4 |
using System.Collections.Generic; |
35 | 5 |
using System.Windows; |
6 |
using System.Windows.Controls; |
|
7 |
using System.Windows.Data; |
|
8 |
using System.Windows.Media; |
|
9 |
using System.Windows.Media.Animation; |
|
10 |
using System.Windows.Navigation; |
|
104 | 11 |
using FingersDance.Control.ListVideo; |
12 |
using FingersDance.Control.SessionInput; |
|
143 | 13 |
using FingersDance.ViewModels; |
14 |
using FingersDance.Data; |
|
35 | 15 |
|
16 |
namespace FingersDance.Control.Screen |
|
17 |
{ |
|
18 |
public partial class UserControlScreen |
|
19 |
{ |
|
82 | 20 |
public String contexteGrid; |
112 | 21 |
public int id = 0; |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
22 |
public event EventHandler UC_Screen_NewCutting; |
143 | 23 |
public MainViewModel MainViewModel; |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
24 |
public CuttingViewModel Cutting; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
25 |
private List<Project> existingProjects = new List<Project>(); |
148 | 26 |
User User = new User(); |
95 | 27 |
|
143 | 28 |
public UserControlScreen(int id, MainViewModel mvmodel) |
29 |
{ |
|
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
30 |
try |
143 | 31 |
{ |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
32 |
this.InitializeComponent(); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
33 |
this.id = id; |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
34 |
MainViewModel = mvmodel; |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
35 |
if (MainViewModel.Project.VideoPath.Equals("")) |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
36 |
{ |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
37 |
//1-Creation de la ListVideo |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
38 |
UserControlListVideo ListVideo = new UserControlListVideo(); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
39 |
ListVideo.Name = "ListVideo1"; |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
40 |
//2-Ajout de la ListVideo au ControlScreen |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
41 |
this.AddToGrid(ListVideo); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
42 |
//3-Creation des Events pour chaque item de la video |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
43 |
ListVideo.EH_ItemVideo1_ContactDown += new System.EventHandler(this.ListVideo_EH_ItemVideo_ContactDown); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
44 |
} |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
45 |
else |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
46 |
OpenProject(); |
143 | 47 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
48 |
catch (Exception) |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
49 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
50 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
51 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
52 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
53 |
} |
143 | 54 |
} |
35 | 55 |
|
82 | 56 |
//Rajout un UIElement vers la grid du screen. |
57 |
public void AddToGrid(UIElement uie) |
|
58 |
{ |
|
59 |
if (uie != null) |
|
60 |
{ |
|
61 |
try { LayoutRoot.Children.Add(uie); } |
|
62 |
catch(Exception){} |
|
63 |
} |
|
64 |
} |
|
65 |
||
104 | 66 |
private void ListVideo_EH_ItemVideo_ContactDown(object sender, EventArgs e) |
67 |
{ |
|
68 |
try |
|
69 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
70 |
//1 renseigner la video choisie au screen et créer un nouveau projet à partir de ce chemin vidéo |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
71 |
MainViewModel.CreateProject(((UserControlListVideo)sender).VideoName, ((UserControlListVideo)sender).path); |
148 | 72 |
//2-Supression du UC List Video |
104 | 73 |
LayoutRoot.Children.Remove((UserControlListVideo)sender); |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
74 |
OpenProjectList(); |
104 | 75 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
76 |
catch (Exception ex) |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
77 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
78 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
79 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
80 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
81 |
} |
104 | 82 |
} |
148 | 83 |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
84 |
private void OpenProjectList() |
148 | 85 |
{ |
86 |
try |
|
87 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
88 |
existingProjects = LoadProjects(MainViewModel.Project.VideoPath); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
89 |
UserControlListSession listProject = new UserControlListSession(existingProjects); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
90 |
listProject.Name = "ListProject"; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
91 |
LayoutRoot.Children.Add(listProject); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
92 |
listProject.EH_List_ContactDown += new EventHandler(listProject_EH_List_ContactDown); |
148 | 93 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
94 |
catch (Exception) |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
95 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
96 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
97 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
98 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
99 |
} |
148 | 100 |
} |
101 |
||
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
102 |
private List<Project> LoadProjects(string name) |
148 | 103 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
104 |
// Does nothing because for the moment we do not load sessions when we know the video path, we just create a new session |
148 | 105 |
try |
106 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
107 |
return new List<Project>(); |
148 | 108 |
} |
109 |
catch (Exception) |
|
110 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
111 |
return new List<Project>(); |
148 | 112 |
} |
113 |
} |
|
114 |
||
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
115 |
void listProject_EH_List_ContactDown(object sender, EventArgs e) |
148 | 116 |
{ |
117 |
try |
|
118 |
{ |
|
119 |
LayoutRoot.Children.Remove((UserControlListSession)sender); |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
120 |
if (((UserControlListSession)sender).SelectedItem.Equals("New Project")) |
148 | 121 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
122 |
UserControlSessionInput ProjectInput = new UserControlSessionInput(); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
123 |
ProjectInput.Name = "ProjectInput"; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
124 |
LayoutRoot.Children.Add(ProjectInput); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
125 |
ProjectInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.ProjectInput_EH_SurfaceButtonSubmit_ContactDown); |
148 | 126 |
} |
127 |
else |
|
128 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
129 |
foreach (Project elt in existingProjects) |
148 | 130 |
{ |
131 |
if (elt.Name.Equals(((UserControlListSession)sender).SelectedItem)) |
|
132 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
133 |
MainViewModel.Project.Project = elt; |
148 | 134 |
OpenProject(); |
135 |
return; |
|
136 |
} |
|
137 |
} |
|
138 |
} |
|
139 |
} |
|
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
140 |
catch (Exception) |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
141 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
142 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
143 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
144 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
145 |
} |
148 | 146 |
} |
147 |
||
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
148 |
private void ProjectInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e) |
104 | 149 |
{ |
150 |
try |
|
151 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
152 |
//MainViewModel.Project.Alias = ((UserControlSessionInput)sender).Alias; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
153 |
//MainViewModel.Project.Email = ((UserControlSessionInput)sender).Email; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
154 |
MainViewModel.Project.Description = ((UserControlSessionInput)sender).Description; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
155 |
MainViewModel.Project.Name = ((UserControlSessionInput)sender).SessionName; |
148 | 156 |
|
104 | 157 |
//2-Suppression UCSession Input |
158 |
LayoutRoot.Children.Remove((UserControlSessionInput)sender); |
|
148 | 159 |
OpenProject(); |
104 | 160 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
161 |
catch (Exception ex) |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
162 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
163 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
164 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
165 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
166 |
} |
104 | 167 |
} |
148 | 168 |
|
169 |
private void OpenProject() |
|
170 |
{ |
|
171 |
try |
|
172 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
173 |
UserControlListProject listCuttings = new UserControlListProject(MainViewModel.Project.CuttingsDict); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
174 |
listCuttings.Name = "listCuttings"; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
175 |
LayoutRoot.Children.Add(listCuttings); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
176 |
listCuttings.EH_Item_ContactDown += new EventHandler(listCuttings_EH_Item_ContactDown); |
148 | 177 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
178 |
catch (Exception) |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
179 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
180 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
181 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
182 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
183 |
} |
148 | 184 |
} |
185 |
||
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
186 |
void listCuttings_EH_Item_ContactDown(object sender, EventArgs e) |
148 | 187 |
{ |
188 |
try |
|
189 |
{ |
|
190 |
LayoutRoot.Children.Remove((UserControlListProject)sender); |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
191 |
if (((UserControlListProject)sender).SelectedItem.Equals("New Cutting")) |
148 | 192 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
193 |
UserControlNewProject newCutting = new UserControlNewProject(User); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
194 |
newCutting.Name = "newCutting"; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
195 |
LayoutRoot.Children.Add(newCutting); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
196 |
newCutting.EH_NewCutting_ContactDown += new EventHandler(newCutting_EH_NewProject_ContactDown); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
197 |
} |
148 | 198 |
else |
199 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
200 |
foreach(KeyValuePair<string, Cutting> elt in MainViewModel.Project.CuttingsDict) |
148 | 201 |
if (elt.Key.Equals(((UserControlListProject)sender).SelectedItem)) |
202 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
203 |
Cutting = new CuttingViewModel(elt.Value, 815); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
204 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
205 |
UC_Screen_NewCutting(this, new EventArgs()); |
148 | 206 |
return; |
207 |
} |
|
208 |
} |
|
209 |
} |
|
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
210 |
catch (Exception) |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
211 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
212 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
213 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
214 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
215 |
} |
148 | 216 |
} |
217 |
||
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
218 |
void newCutting_EH_NewProject_ContactDown(object sender, EventArgs e) |
148 | 219 |
{ |
220 |
try |
|
221 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
222 |
Console.WriteLine("newCutting_EH_NewProject_ContactDown"); |
148 | 223 |
LayoutRoot.Children.Remove((UserControlNewProject)sender); |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
224 |
Cutting = new CuttingViewModel(((UserControlNewProject)sender).Cutting, 850); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
225 |
MainViewModel.Project.CuttingsDict.Add(Cutting.Title, ((UserControlNewProject)sender).Cutting); |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
226 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
227 |
UC_Screen_NewCutting(this, new EventArgs()); |
148 | 228 |
} |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
229 |
catch (Exception) |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
230 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
231 |
Cutting = null; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
232 |
if (UC_Screen_NewCutting != null) |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
156
diff
changeset
|
233 |
UC_Screen_NewCutting(this, new EventArgs()); |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
148
diff
changeset
|
234 |
} |
148 | 235 |
} |
35 | 236 |
} |
237 |
} |