author | cavaliet |
Thu, 12 Nov 2009 16:15:19 +0100 | |
changeset 192 | 11083c390ce4 |
parent 182 | 25b49d4f1635 |
permissions | -rw-r--r-- |
143 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using FingersDance.Data; |
|
6 |
||
7 |
namespace FingersDance.ViewModels |
|
8 |
{ |
|
9 |
public class ProjectViewModel : ViewModelBase |
|
10 |
{ |
|
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:
148
diff
changeset
|
11 |
private Project project = new Project(); |
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:
148
diff
changeset
|
12 |
|
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:
148
diff
changeset
|
13 |
private Dictionary<String, Cutting> _cuttingsDict = new Dictionary<string,Cutting>(); |
143 | 14 |
|
15 |
#region Constructor |
|
16 |
||
17 |
public ProjectViewModel() { } |
|
18 |
||
19 |
public ProjectViewModel(Project p) |
|
20 |
{ |
|
21 |
project = p; |
|
192
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
182
diff
changeset
|
22 |
_cuttingsDict = new Dictionary<string, Cutting>(); |
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
182
diff
changeset
|
23 |
foreach(Cutting cut in project.Cuttings) |
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
182
diff
changeset
|
24 |
{ |
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
182
diff
changeset
|
25 |
_cuttingsDict.Add(cut.Title, cut); |
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
182
diff
changeset
|
26 |
} |
143 | 27 |
} |
28 |
||
29 |
#endregion |
|
30 |
||
31 |
#region Properties |
|
148 | 32 |
|
33 |
public Project Project |
|
34 |
{ |
|
35 |
get { return project; } |
|
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:
148
diff
changeset
|
36 |
set { project = value; } |
148 | 37 |
} |
38 |
||
39 |
public string Date |
|
40 |
{ |
|
41 |
get { return project.Date; } |
|
42 |
set { project.Date = value; } |
|
43 |
} |
|
44 |
||
45 |
public string Name |
|
46 |
{ |
|
47 |
get { return project.Name; } |
|
48 |
set { project.Name = value; } |
|
49 |
} |
|
50 |
||
51 |
public string Description |
|
52 |
{ |
|
53 |
get { return project.Description; } |
|
54 |
set { project.Description = value; } |
|
55 |
} |
|
56 |
||
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:
148
diff
changeset
|
57 |
public String VideoPath |
143 | 58 |
{ |
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:
148
diff
changeset
|
59 |
get { return 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:
148
diff
changeset
|
60 |
set { project.VideoPath = value; } |
143 | 61 |
} |
62 |
||
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:
148
diff
changeset
|
63 |
public List<Cutting> Cuttings |
143 | 64 |
{ |
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:
148
diff
changeset
|
65 |
get { return project.Cuttings; } |
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:
148
diff
changeset
|
66 |
set { project.Cuttings = value; } |
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:
148
diff
changeset
|
67 |
} |
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:
148
diff
changeset
|
68 |
|
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:
148
diff
changeset
|
69 |
public Dictionary<String, Cutting> 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:
148
diff
changeset
|
70 |
{ |
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:
148
diff
changeset
|
71 |
get { return _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:
148
diff
changeset
|
72 |
set { _cuttingsDict = value; } |
143 | 73 |
} |
74 |
||
75 |
#endregion |
|
76 |
} |
|
77 |
} |