client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs
changeset 18 66911d0f0eb6
parent 17 0e4e63f6f567
child 19 7d044e7562ea
equal deleted inserted replaced
17:0e4e63f6f567 18:66911d0f0eb6
    37         }
    37         }
    38 
    38 
    39         private void AddSequenceButton_Click(object sender, System.Windows.RoutedEventArgs e)
    39         private void AddSequenceButton_Click(object sender, System.Windows.RoutedEventArgs e)
    40         {
    40         {
    41             Random rndNumbers = new Random();
    41             Random rndNumbers = new Random();
    42             if(!((ProductionTimeLineVM)DataContext).IsIndexing)
    42             if (((ProductionTimeLineVM)this.DataContext).SelectedChapter != -1)
    43             {
    43             {
       
    44                 if(!((ProductionTimeLineVM)DataContext).IsIndexing)
       
    45                 {
    44 
    46 
    45             CustomableVideoElement _temp = new CustomableVideoElement()
    47                 CustomableVideoElement _temp = new CustomableVideoElement()
    46                                      {
       
    47                                          DataContext = new CustomableVideoElementVM(new VideoSequence()
       
    48                                          {
    48                                          {
       
    49                                              DataContext = new CustomableVideoElementVM(new VideoSequence()
       
    50                                              {
    49 
    51 
    50                                              RunTime = new TimeSpan(0, rndNumbers.Next(10, 60), 0),
    52                                                  RunTime = new TimeSpan(0, rndNumbers.Next(10, 60), 0),
    51                                              BeginTrim = new TimeSpan(0, 0, 0),
    53                                                  BeginTrim = new TimeSpan(0, 0, 0),
    52                                              EndTrim = new TimeSpan(0, 0, 0),
    54                                                  EndTrim = new TimeSpan(0, 0, 0),
    53 
    55 
    54                                          }) { Chapter = ((ProductionTimeLineVM)this.DataContext).SelectedChapterType},
    56                                              }) { Chapter = ((ProductionTimeLineVM)this.DataContext).SelectedChapterType},
    55                                          // Width = 200
    57                                              // Width = 200
    56                                      };
    58                                          };
    57             
    59                 
    58             _temp.MouseMove += new MouseEventHandler(CustomableVideoElement_MouseMove);
    60                 _temp.MouseMove += new MouseEventHandler(CustomableVideoElement_MouseMove);
    59             _temp.MouseLeftButtonDown += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonDown);
    61                 _temp.MouseLeftButtonDown += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonDown);
    60             _temp.MouseLeftButtonUp += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonUp);
    62                 _temp.MouseLeftButtonUp += new MouseButtonEventHandler(CustomableVideoElement_MouseLeftButtonUp);
    61             
    63                 
    62                VideoTimeStrip.Children.Add(_temp  );// TODO: Add event handler implementation here.
    64                    VideoTimeStrip.Children.Add(_temp  );// TODO: Add event handler implementation here.
    63             }
    65                 }
    64             else
    66                 else
    65             {
       
    66                 VideoChapter vc = ((ProductionTimeLineVM)DataContext).SelectedBookChapter;
       
    67                 PolemicElementControl an = new PolemicElementControl()
       
    68                 {
    67                 {
    69                     DataContext = new PolemicElementVM(new SegmentIndex(vc))
    68                     VideoChapter vc = ((ProductionTimeLineVM)DataContext).SelectedBookChapter;
    70                     {
    69                     PolemicElementControl an = new PolemicElementControl();
    71                         TimerIn = TimeSpan.Zero,
    70                     an.DataContext = new PolemicElementVM(new SegmentIndex(vc)
    72                         Duration = new TimeSpan(0, rndNumbers.Next(10, 60), 0)
    71                         {
    73                     },
    72                             TimerIn = TimeSpan.Zero,
    74                 };
    73                             Duration = new TimeSpan(0, rndNumbers.Next(10, 60), 0),
    75                     //((ProductionTimeLineVM)DataContext).SelectedBookChapter);
    74                             Chapter = vc,
    76                 AnnotationTimeStrip.Children.Add(an);
    75 
       
    76                         });
       
    77                     
       
    78                         //((ProductionTimeLineVM)DataContext).SelectedBookChapter);
       
    79                     AnnotationTimeStrip.Children.Add(an);
       
    80                 }
    77             }
    81             }
    78         }
    82         }
    79 
    83 
    80         
    84         
    81 
    85