18 public partial class ProductionTimeLine : UserControl |
18 public partial class ProductionTimeLine : UserControl |
19 { |
19 { |
20 public static double ScaleTime |
20 public static double ScaleTime |
21 { |
21 { |
22 get |
22 get |
23 { |
23 ; |
24 return 0.0002; |
24 |
25 } |
25 |
|
26 set; |
26 } |
27 } |
27 public ProductionTimeLine() |
28 public ProductionTimeLine() |
28 { |
29 { |
|
30 ScaleTime = 0.0002; |
29 // Required to initialize variables |
31 // Required to initialize variables |
30 InitializeComponent(); |
32 InitializeComponent(); |
31 Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed); |
33 Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed); |
32 Commands.ProductionView.VideoRecordUpdated.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(VideoRecordUpdated_Executed); |
34 Commands.ProductionView.VideoRecordUpdated.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(VideoRecordUpdated_Executed); |
33 Commands.Action.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(Action_Executed); |
35 Commands.Action.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(Action_Executed); |
34 TimeSlider.MouseLeftButtonUp += new MouseButtonEventHandler(TimeSlider_MouseLeftButtonUp); |
36 TimeSlider.MouseLeftButtonUp += new MouseButtonEventHandler(TimeSlider_MouseLeftButtonUp); |
35 //TimeSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(TimeSlider_ValueChanged); |
37 //TimeSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(TimeSlider_ValueChanged); |
36 TimeSlider.Maximum = TimeSlider.ActualWidth / ProductionTimeLine.ScaleTime; |
38 TimeSlider.Maximum = TimeSlider.ActualWidth / ProductionTimeLine.ScaleTime; |
|
39 |
|
40 ScaleTimeLine.ValueChanged += new RoutedPropertyChangedEventHandler<double>(ScaleTimeLine_ValueChanged); |
37 } |
41 } |
|
42 |
|
43 void ScaleTimeLine_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) |
|
44 { |
|
45 ScaleTime = e.NewValue / 3200000; |
|
46 UpdateElements(); |
|
47 |
|
48 } |
38 |
49 |
39 void TimeSlider_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) |
50 void TimeSlider_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) |
40 { |
51 { |
41 Commands.TimeChange.Execute(TimeSlider.Value,DataContext); |
52 Commands.TimeChange.Execute(TimeSlider.Value,DataContext); |
42 } |
53 } |
87 ChapterColor = FactoryVideoLivre.VideoChapterDescriptions[intChapter].Color |
98 ChapterColor = FactoryVideoLivre.VideoChapterDescriptions[intChapter].Color |
88 } |
99 } |
89 |
100 |
90 }; |
101 }; |
91 _temp.MouseLeftButtonDown += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonDown); |
102 _temp.MouseLeftButtonDown += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonDown); |
92 if ((VideoChapterType)intChapter == ((ProductionTimeLineVM)this.DataContext).SelectedBookChapter.Type) |
103 //if ((VideoChapterType)intChapter == ((ProductionTimeLineVM)this.DataContext).SelectedBookChapter.Type) |
93 { |
104 //{ |
94 _temp.MouseMove += new MouseEventHandler(CustomableVideoElement_MouseMove); |
105 _temp.MouseMove += new MouseEventHandler(CustomableVideoElement_MouseMove); |
95 |
106 |
96 _temp.MouseLeftButtonUp += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonUp); |
107 _temp.MouseLeftButtonUp += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonUp); |
97 } |
108 //} |
98 VideoTimeStrip.Children.Add(_temp);// TODO: Add event handler implementation here. |
109 VideoTimeStrip.Children.Add(_temp);// TODO: Add event handler implementation here. |
99 _sumOfLengh += _temp.Width; |
110 _sumOfLengh += _temp.Width; |
100 } |
111 } |
101 intChapter++; |
112 intChapter++; |
102 } |
113 } |