|
16
|
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.BaseMVVM.Commands; |
|
|
12 |
using Iri.Modernisation.BaseMVVM.ViewModel; |
|
18
|
13 |
using Iri.Modernisation.Controls.View; |
|
19
|
14 |
using Iri.Modernisation.Data.Models; |
|
|
15 |
using System.Collections.ObjectModel; |
|
|
16 |
using System.Collections.Generic; |
|
16
|
17 |
namespace Iri.Modernisation.Controls.ViewModel |
|
|
18 |
{ |
|
|
19 |
public class ProductionViewVM : BaseMVVM.ViewModel.ViewModel |
|
|
20 |
{ |
|
19
|
21 |
|
|
|
22 |
private VideoSequence _selectedVideoSequence; |
|
|
23 |
public VideoSequence SelectedVideoSequence |
|
|
24 |
{ |
|
|
25 |
get |
|
|
26 |
{ |
|
|
27 |
return _selectedVideoSequence; |
|
|
28 |
} |
|
|
29 |
set |
|
|
30 |
{ |
|
|
31 |
_selectedVideoSequence = value; |
|
|
32 |
OnPropertyChanged("SelectedVideoSequence"); |
|
|
33 |
|
|
|
34 |
} |
|
|
35 |
} |
|
|
36 |
|
|
|
37 |
private ObservableCollection<VideoSequence> _recordedVideoSequences; |
|
|
38 |
public ObservableCollection<VideoSequence> RecordedVideoSequences |
|
|
39 |
{ |
|
|
40 |
get |
|
|
41 |
{ |
|
|
42 |
return _recordedVideoSequences; |
|
|
43 |
} |
|
|
44 |
set |
|
|
45 |
{ |
|
|
46 |
_recordedVideoSequences = value; |
|
|
47 |
OnPropertyChanged("RecordedVideoSequences"); |
|
|
48 |
} |
|
|
49 |
} |
|
|
50 |
|
|
|
51 |
|
|
16
|
52 |
private HeaderProductionVM _headerProductionVM; |
|
|
53 |
public HeaderProductionVM ViewModelHeaderProduction |
|
|
54 |
{ |
|
|
55 |
get |
|
|
56 |
{ |
|
|
57 |
return _headerProductionVM; |
|
|
58 |
} |
|
|
59 |
set |
|
|
60 |
{ |
|
|
61 |
_headerProductionVM = value; |
|
|
62 |
OnPropertyChanged("ViewModelHeaderProduction"); |
|
|
63 |
} |
|
|
64 |
} |
|
|
65 |
private ProductionTimeLineVM _productionTimeLineVM; |
|
|
66 |
public ProductionTimeLineVM ViewModelProductionTimeLine |
|
|
67 |
{ |
|
|
68 |
get |
|
|
69 |
{ |
|
|
70 |
return _productionTimeLineVM; |
|
|
71 |
} |
|
|
72 |
set |
|
|
73 |
{ |
|
|
74 |
_productionTimeLineVM = value; |
|
|
75 |
OnPropertyChanged("ViewModelProductionTimeLine"); |
|
|
76 |
} |
|
|
77 |
} |
|
18
|
78 |
//SelectedChapter |
|
16
|
79 |
public ProductionViewVM() |
|
|
80 |
{ |
|
19
|
81 |
RecordedVideoSequences = new ObservableCollection<VideoSequence>(); |
|
16
|
82 |
ViewModelHeaderProduction = new HeaderProductionVM(); |
|
|
83 |
ViewModelProductionTimeLine = new ProductionTimeLineVM(); |
|
19
|
84 |
Commands.ProductionView.ClickAddSelectedRecord.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddSelectedRecord_Executed); |
|
|
85 |
Random rndNumbers = new Random(); |
|
|
86 |
for (int i = 0; i < 10; i++) |
|
|
87 |
{ |
|
|
88 |
|
|
|
89 |
_recordedVideoSequences.Add(new VideoSequence() |
|
|
90 |
{ |
|
|
91 |
Path="/Pouet/Record_"+rndNumbers.Next(10, 60), |
|
|
92 |
RunTime = new TimeSpan(0, rndNumbers.Next(10, 60), 0), |
|
|
93 |
BeginTrim = new TimeSpan(0, 0, 0), |
|
|
94 |
EndTrim = new TimeSpan(0, 0, 0), |
|
|
95 |
}); |
|
|
96 |
} |
|
18
|
97 |
|
|
16
|
98 |
} |
|
18
|
99 |
|
|
19
|
100 |
void ClickAddSelectedRecord_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
101 |
{ |
|
20
|
102 |
if (ViewModelProductionTimeLine.SelectedChapter != -1) |
|
|
103 |
{ |
|
|
104 |
if (!ViewModelProductionTimeLine.IsIndexing) |
|
|
105 |
{ |
|
|
106 |
if(SelectedVideoSequence!=null) |
|
|
107 |
ViewModelProductionTimeLine.SelectedVideoSequences.Add(new VideoSequence(SelectedVideoSequence)); |
|
|
108 |
} |
|
|
109 |
|
|
|
110 |
} |
|
19
|
111 |
|
|
|
112 |
} |
|
|
113 |
|
|
18
|
114 |
|
|
16
|
115 |
} |
|
|
116 |
} |