author | cavaliet |
Wed, 28 Oct 2009 17:07:27 +0100 | |
changeset 182 | 25b49d4f1635 |
parent 167 | 206f07a8d887 |
child 190 | 619ca3ae13c7 |
permissions | -rw-r--r-- |
55 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
||
69 | 6 |
using FingersDance.Data; |
7 |
||
8 |
namespace FingersDance.ViewModels |
|
55 | 9 |
{ |
69 | 10 |
public class CuttingViewModel : ViewModelBase |
55 | 11 |
{ |
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:
167
diff
changeset
|
12 |
private Cutting cut; |
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:
167
diff
changeset
|
13 |
|
55 | 14 |
private List<AnnotationViewModel> _annotList = new List<AnnotationViewModel>(); |
69 | 15 |
|
143 | 16 |
public CuttingViewModel(Cutting c, float annotWidth) { |
69 | 17 |
|
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:
167
diff
changeset
|
18 |
cut = c; |
69 | 19 |
this._annotList = new List<AnnotationViewModel>(); |
143 | 20 |
int i = 0; |
69 | 21 |
foreach (Annotation annot in c.AnnotList) |
143 | 22 |
{ |
23 |
this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth))); |
|
24 |
i++; |
|
25 |
} |
|
69 | 26 |
|
27 |
} |
|
28 |
||
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:
167
diff
changeset
|
29 |
public Cutting 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:
167
diff
changeset
|
30 |
{ |
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:
167
diff
changeset
|
31 |
get { return cut; } |
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:
167
diff
changeset
|
32 |
set |
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:
167
diff
changeset
|
33 |
{ |
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:
167
diff
changeset
|
34 |
cut = 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:
167
diff
changeset
|
35 |
base.OnPropertyChanged("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:
167
diff
changeset
|
36 |
} |
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:
167
diff
changeset
|
37 |
} |
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:
167
diff
changeset
|
38 |
|
143 | 39 |
public String Title |
55 | 40 |
{ |
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:
167
diff
changeset
|
41 |
get { return cut.Title; } |
55 | 42 |
set |
43 |
{ |
|
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:
167
diff
changeset
|
44 |
if (value == cut.Title || String.IsNullOrEmpty(value)) |
55 | 45 |
return; |
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:
167
diff
changeset
|
46 |
cut.Title = value; |
55 | 47 |
base.OnPropertyChanged("Title"); |
48 |
} |
|
49 |
} |
|
50 |
public List<AnnotationViewModel> AnnotList |
|
51 |
{ |
|
52 |
get { return _annotList; } |
|
53 |
set |
|
54 |
{ |
|
55 |
_annotList = value; |
|
56 |
base.OnPropertyChanged("AnnotList"); |
|
57 |
} |
|
58 |
} |
|
143 | 59 |
|
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
146
diff
changeset
|
60 |
public void setListFromAnnotations(List<Annotation> annotList, float annotWidth, Double scaleX) |
143 | 61 |
{ |
62 |
||
63 |
this._annotList = new List<AnnotationViewModel>(); |
|
64 |
int i = 0; |
|
65 |
foreach (Annotation annot in annotList) |
|
66 |
{ |
|
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
146
diff
changeset
|
67 |
this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth), 1/scaleX)); |
143 | 68 |
i++; |
69 |
} |
|
70 |
||
71 |
} |
|
55 | 72 |
} |
73 |
} |