author | cavaliet |
Mon, 05 Oct 2009 15:56:27 +0200 | |
changeset 129 | 1f37ef03ebee |
parent 69 | a4c44555f205 |
child 130 | 192da585bee5 |
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 |
{ |
12 |
private string _title; |
|
13 |
private List<AnnotationViewModel> _annotList = new List<AnnotationViewModel>(); |
|
69 | 14 |
|
129
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
15 |
public CuttingViewModel(Cutting c, float annotWidth) { |
69 | 16 |
|
17 |
this._title = c.Title; |
|
18 |
this._annotList = new List<AnnotationViewModel>(); |
|
129
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
19 |
int i = 0; |
69 | 20 |
foreach (Annotation annot in c.AnnotList) |
129
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
21 |
{ |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
22 |
this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth))); |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
23 |
i++; |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
24 |
} |
69 | 25 |
|
26 |
} |
|
27 |
||
55 | 28 |
public String Title |
29 |
{ |
|
30 |
get { return _title; } |
|
31 |
set |
|
32 |
{ |
|
33 |
if (value == _title || String.IsNullOrEmpty(value)) |
|
34 |
return; |
|
35 |
_title = value; |
|
36 |
base.OnPropertyChanged("Title"); |
|
37 |
} |
|
38 |
} |
|
39 |
public List<AnnotationViewModel> AnnotList |
|
40 |
{ |
|
41 |
get { return _annotList; } |
|
42 |
set |
|
43 |
{ |
|
44 |
_annotList = value; |
|
45 |
base.OnPropertyChanged("AnnotList"); |
|
46 |
} |
|
47 |
} |
|
129
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
48 |
|
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
49 |
public void setListFromAnnotations(List<Annotation> annotList, float annotWidth) |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
50 |
{ |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
51 |
|
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
52 |
this._annotList = new List<AnnotationViewModel>(); |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
53 |
int i = 0; |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
54 |
foreach (Annotation annot in annotList) |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
55 |
{ |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
56 |
this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth))); |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
57 |
i++; |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
58 |
} |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
59 |
|
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
60 |
} |
55 | 61 |
} |
62 |
} |