|
0
|
1 |
using System; |
|
|
2 |
using System.Net; |
|
|
3 |
using System.Windows; |
|
|
4 |
using System.Windows.Controls; |
|
|
5 |
using System.Windows.Documents; |
|
|
6 |
using System.Windows.Ink; |
|
|
7 |
using System.Windows.Input; |
|
|
8 |
using System.Windows.Media; |
|
|
9 |
using System.Windows.Media.Animation; |
|
|
10 |
using System.Windows.Shapes; |
|
|
11 |
using Iri.Modernisation.Data.Models; |
|
|
12 |
using Iri.Modernisation.BaseMVVM.Commands; |
|
|
13 |
using Iri.Modernisation.BaseMVVM.ViewModel; |
|
17
|
14 |
using Iri.Modernisation.Controls.View; |
|
0
|
15 |
using System.Collections.Generic; |
|
19
|
16 |
using SLExtensions.Collections.ObjectModel; |
|
0
|
17 |
namespace Iri.Modernisation.Controls.ViewModel |
|
|
18 |
{ |
|
|
19 |
public class ProductionTimeLineVM : BaseMVVM.ViewModel.ViewModel |
|
|
20 |
{ |
|
|
21 |
|
|
17
|
22 |
|
|
|
23 |
private bool _isIndexing; |
|
|
24 |
public bool IsIndexing |
|
|
25 |
{ |
|
|
26 |
get |
|
|
27 |
{ |
|
|
28 |
return _isIndexing; |
|
|
29 |
} |
|
|
30 |
set |
|
|
31 |
{ |
|
|
32 |
_isIndexing = value; |
|
|
33 |
OnPropertyChanged("IsIndexing"); |
|
|
34 |
} |
|
|
35 |
} |
|
0
|
36 |
|
|
|
37 |
private VideoBook _newBook; |
|
19
|
38 |
private ObservableCollection<VideoSequence>[] _listVideoSequences = new ObservableCollection<VideoSequence>[4]; |
|
|
39 |
public ObservableCollection<VideoSequence>[] ListVideoSequences |
|
0
|
40 |
{ |
|
|
41 |
get |
|
|
42 |
{ |
|
19
|
43 |
return _listVideoSequences; |
|
|
44 |
} |
|
|
45 |
set |
|
|
46 |
{ |
|
|
47 |
_listVideoSequences = value; |
|
|
48 |
OnPropertyChanged("ListVideoSequences"); |
|
|
49 |
} |
|
|
50 |
} |
|
|
51 |
|
|
|
52 |
public ObservableCollection<VideoSequence> SelectedVideoSequences |
|
|
53 |
{ |
|
|
54 |
get |
|
|
55 |
{ |
|
|
56 |
|
|
0
|
57 |
return _listVideoSequences[SelectedChapter]; |
|
|
58 |
} |
|
|
59 |
set |
|
|
60 |
{ |
|
|
61 |
_listVideoSequences[SelectedChapter] = value; |
|
19
|
62 |
//_newBook.Chapters[SelectedChapter].VideoSequences = value; |
|
0
|
63 |
OnPropertyChanged("SelectedVideoSequences"); |
|
|
64 |
} |
|
|
65 |
} |
|
17
|
66 |
|
|
|
67 |
public VideoChapter[] Chapters |
|
|
68 |
{ |
|
|
69 |
get |
|
|
70 |
{ |
|
|
71 |
return _newBook.Chapters; |
|
|
72 |
} |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
} |
|
|
76 |
public VideoChapter SelectedBookChapter |
|
|
77 |
{ |
|
|
78 |
get |
|
|
79 |
{ |
|
|
80 |
return _newBook.Chapters[SelectedChapter]; |
|
|
81 |
} |
|
|
82 |
} |
|
|
83 |
|
|
0
|
84 |
private int _selectedChapter=0; |
|
|
85 |
public int SelectedChapter |
|
|
86 |
{ |
|
|
87 |
get |
|
|
88 |
{ |
|
|
89 |
return _selectedChapter; |
|
|
90 |
} |
|
|
91 |
set |
|
|
92 |
{ |
|
|
93 |
_selectedChapter = value; |
|
|
94 |
OnPropertyChanged("SelectedChapter"); |
|
|
95 |
} |
|
|
96 |
} |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
private List<SegmentIndex>[] _listSegmentIndex = new List<SegmentIndex>[4]; |
|
|
101 |
public List<SegmentIndex> SelectedIndex |
|
|
102 |
{ |
|
|
103 |
get |
|
|
104 |
{ |
|
|
105 |
return _listSegmentIndex[SelectedChapter]; |
|
|
106 |
} |
|
|
107 |
set |
|
|
108 |
{ |
|
|
109 |
_listSegmentIndex[SelectedChapter] = value; |
|
|
110 |
_newBook.Chapters[SelectedChapter].Index = value; |
|
|
111 |
OnPropertyChanged("SelectedIndex"); |
|
|
112 |
} |
|
|
113 |
} |
|
|
114 |
|
|
17
|
115 |
private VideoChapterType _selectedChapterType; |
|
|
116 |
public VideoChapterType SelectedChapterType |
|
|
117 |
{ |
|
|
118 |
get |
|
|
119 |
{ |
|
|
120 |
return _selectedChapterType; |
|
|
121 |
} |
|
|
122 |
set |
|
|
123 |
{ |
|
|
124 |
_selectedChapterType = value; |
|
|
125 |
OnPropertyChanged("SelectedChapterType"); |
|
|
126 |
} |
|
|
127 |
} |
|
|
128 |
|
|
|
129 |
|
|
0
|
130 |
public ProductionTimeLineVM() |
|
|
131 |
{ |
|
|
132 |
_newBook = new VideoBook(); |
|
19
|
133 |
_listVideoSequences = new ObservableCollection<VideoSequence>[4] |
|
|
134 |
{ |
|
|
135 |
new ObservableCollection<VideoSequence>(), |
|
|
136 |
new ObservableCollection<VideoSequence>(), |
|
|
137 |
new ObservableCollection<VideoSequence>(), |
|
|
138 |
new ObservableCollection<VideoSequence>() |
|
|
139 |
}; |
|
|
140 |
// PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ProductionTimeLineVM_PropertyChanged); |
|
|
141 |
// SelectedVideoSequences = new ObservableCollection<VideoSequence>(); |
|
17
|
142 |
Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed); |
|
18
|
143 |
Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartFinished_Executed); |
|
19
|
144 |
_listVideoSequences[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
|
145 |
_listVideoSequences[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
|
146 |
_listVideoSequences[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
|
147 |
_listVideoSequences[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
|
148 |
|
|
|
149 |
} |
|
|
150 |
|
|
|
151 |
void SelectedVideoSequences_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) |
|
|
152 |
{ |
|
|
153 |
Commands.ProductionView.VideoRecordUpdated.Execute(); |
|
|
154 |
} |
|
|
155 |
|
|
|
156 |
void ProductionTimeLineVM_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) |
|
|
157 |
{ |
|
|
158 |
Commands.ProductionView.VideoRecordUpdated.Execute(); |
|
|
159 |
} |
|
17
|
160 |
|
|
18
|
161 |
void EditorPartFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
162 |
{ |
|
|
163 |
SelectedChapter = -1; |
|
|
164 |
} |
|
|
165 |
|
|
17
|
166 |
void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
167 |
{ |
|
18
|
168 |
|
|
|
169 |
SelectedChapter = (int)((HeaderProductionEventArgs)e.Source).ChapterType; |
|
17
|
170 |
SelectedChapterType = ((HeaderProductionEventArgs)e.Source).ChapterType ; |
|
|
171 |
IsIndexing = ((HeaderProductionEventArgs)e.Source).IsIndexPart; |
|
0
|
172 |
} |
|
|
173 |
} |
|
|
174 |
} |